目录
一、简介
Exceptionless为您提供了跟踪错误、日志和事件的工具,同时指导您找到可行的解决方案。首先,您需要决定是自托管Exceptionless还是使用我们的托管版本。如果您选择使用我们的托管版本,您可以免费开始使用。
官网地址:https://exceptionless.com/
Github地址:https://github.com/exceptionless
Exceptionless 项目:https://github.com/exceptionless/Exceptionless (内置UI)
Exceptionless.UI项目(已过期):
Warning 存储库已存档,不再进行维护。所有源代码和问题都已移动到https://github.com/exceptionless/Exceptionless.请使用新的存储库进行任何未来的查询或贡献
二、版本
采用官网最新的版本
Exceptionless:v8.0.4
Exceptionless.UI:v3.1.12(已过期)
Elasticsearch:v8.8.1
三、运行说明
1、Exceptionless
这是一个API项目,包含所有的API,环境采用.NET 7.0
,服务器必须安装.NET 7.0运行环境
2、Elasticsearch
存储相关数据,内置jdk,推荐按照DockerCompose指定的版本,
3、Exceptionless.UI
查看异常、设置新异常邮件通知等操作的后台,采用angular写的,v3.1.12
必须采用的 Node 10.24.*
,以及安装Python环境,如果采用内置的ClientApp则采用Node 18+
,无需Python环境
四、打包Exceptionless.UI
v3.1.12(已过期)
npm install
npx bower install
npx grunt build
ClientApp在发布Exceptionless.Web的时候会执行打包
npm install # 添加依赖
npm run build # 打包
npm run serve
单独部署
需要指定
BASE_URL
,也就是API请求地址,默认是window.location.origin
,也可以通过打包后去修改app.config.911ab0f5f056fec6.js
文件
USE_HTML5_MODE
:是否采用H5模式,也就是默认Hash模式,后面有#号,而邮件发过来的url会类似http://localhost:5100/type/error/frequent
,导致不能访问,所以constant('USE_HTML5_MODE', false) 修改该值为true
五、window部署
1. Elasticsearch
部署请网上自行查询,如果是开启外网访问,建议开启xpath
8.0版本以上,默认是https,需要关闭 xpack.security.enabled: false
,如果需要开启xpath验证,需要生成证书,否则无法访问
配置文件elasticsearch.yml
xpack.security.enabled: false
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
cluster.name: es-master-node
node.name: es-master-node
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["es-master-node"]
Elasticsearch默认最小内存是4G,如需修改请修改jvm.options
## -Xms4g
## -Xmx4g
安装mapper-size
https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-size.html
elasticsearch-plugin.bat install mapper-size
查看运行信息
2.Exceptionless
下载.NET 7.0运行时
https://dotnet.microsoft.com/zh-cn/download/dotnet/7.0
编译项目
选择 Exceptionless.Web
发布
在 Exceptionless.Web.csproj
配置了发布前执行的命令,会打包前端项目
<Target Name="PublishRunWebBuild" AfterTargets="ComputeFilesToPublish" Condition="'$(SkipSpaPublish)' != 'true'">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm ci" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" />
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
会将 ClientApp
打包到wwwroot的目录下
运行
dotnet Exceptionless.Web.dll --urls=http://localhost:9000
配置文件
---
ConnectionStrings:
# Redis: server="localhost,abortConnect=false"
Elasticsearch: server=http://localhost:9200
# Cache: provider=redis;
# MessageBus: provider=redis;
# Queue: provider=redis;
Storage: provider=folder;path=.\storage
# LDAP: ''
# Email: smtp://localhost:1025
# Base url for the ui used to build links in emails and other places.
BaseURL: 'http://localhost:9001/#!'
# Wether or not to run the jobs in process. Requires Redis to be configured when running jobs out of process.
RunJobsInProcess: true
#AppScope: dev
#EnableAccountCreation: false
#DisableIndexConfiguration: false
#AllowedOutboundAddresses: "exceptionless"
Serilog:
MinimumLevel:
Default: Debug
Apm:
#Endpoint: http://localhost:4317
Insecure: true
#SslThumbprint: CB16E1B3DFE42DF751F93A8575942DA89E10BC98
EnableLogs: false
EnableTracing: false
EnableMetrics: true
FullDetails: true
Debug: false
Console: false
每一个配置项具体可查看AppOptions类
首Exceptionless.Web项目加载配置文件,是根据系统环境变量来加载不同的配置文件的(如果不知道是什么搜一下windows系统环境变量,其他系统自行百度)
如果系统环境变量中存在 EX_AppMode 的话,比如 EX_AppMode=Staging则加载 appsettings.Staging.yml 文件。(EX_AppMode如果不存在则为 Production)
public static IHostBuilder CreateHostBuilder(string[] args)
{
string environment = Environment.GetEnvironmentVariable("EX_AppMode");
if (String.IsNullOrWhiteSpace(environment))
environment = "Production";
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddYamlFile("appsettings.yml", optional: true, reloadOnChange: true)
.AddYamlFile($"appsettings.{environment}.yml", optional: true, reloadOnChange: true)
.AddEnvironmentVariables("EX_")
.AddEnvironmentVariables("ASPNETCORE_")
.AddCommandLine(args)
.Build();
}
效果图
六、Docker部署
我们可以看到它在docker-compose里面的服务
version: "2.2"
services:
elasticsearch:
image: exceptionless/elasticsearch:8.9.0
environment:
node.name: elasticsearch
cluster.name: exceptionless
discovery.type: single-node
xpack.security.enabled: "false"
action.destructive_requires_name: false
ES_JAVA_OPTS: -Xms1g -Xmx1g
ports:
- 9200:9200
volumes:
- esdata:/usr/share/elasticsearch/data
kibana:
depends_on:
- elasticsearch
image: docker.elastic.co/kibana/kibana:8.9.0
environment:
xpack.security.enabled: "false"
ports:
- 5601:5601
redis:
image: redis:6-alpine
ports:
- 6379:6379
mail:
image: mailhog/mailhog:latest
ports:
- 8025:8025
- 1025:1025
volumes:
esdata:
driver: local
标签:Exceptionless,false,Windows,elasticsearch,https,Linux,http,true
From: https://www.cnblogs.com/vic-tory/p/17655471.html