feat: add Exceptionless

This commit is contained in:
Argo-Cloud 2021-04-05 19:14:35 +08:00
parent 80f5c1be1f
commit ed072c229d
3 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="BootstrapBlazor" Version="5.0.19" />
<PackageReference Include="Exceptionless.AspNetCore" Version="4.6.2" />
<PackageReference Include="Longbow.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
<PackageReference Include="Sentry.AspNetCore" Version="3.1.0" />

View File

@ -1,4 +1,5 @@
using Bootstrap.DataAccess;
using Exceptionless;
using Longbow.Web.SignalR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
@ -80,6 +81,7 @@ namespace Bootstrap.Admin
option.AssumeDefaultVersionWhenUnspecified = true;
option.ApiVersionReader = ApiVersionReader.Combine(new HeaderApiVersionReader("api-version"), new QueryStringApiVersionReader("api-version"));
});
services.AddExceptionless();
services.AddControllersWithViews(options =>
{
options.Filters.Add<BootstrapAdminAuthorizeFilter>();
@ -122,6 +124,7 @@ namespace Bootstrap.Admin
app.UseRouting();
app.UseCors(builder => builder.WithOrigins(Configuration["AllowOrigins"].Split(',', StringSplitOptions.RemoveEmptyEntries)).AllowAnyHeader().AllowAnyMethod().AllowCredentials());
app.UseExceptionless();
app.UseBootstrapAdminAuthentication(RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
app.UseAuthorization();
app.UseSwagger(Configuration["SwaggerPathBase"].TrimEnd('/'));

View File

@ -69,12 +69,15 @@
"Sentry": {
"Dsn": "https://70bdfff562e84fa7b9a43d65924ab9ad@sentry.io/1469396"
},
"Exceptionless": {
"ApiKey": "AgQlY1MRWpX5qOF2edpK2IZYBhgPYImhr4UnZdAT"
},
"TokenValidateOption": {
"Issuer": "BA",
"Audience": "api",
"Expires": 5,
"SecurityKey": "BootstrapAdmin-V1.1"
},
},
"TaskServicesOptions": {
"ShutdownTimeout": "00:00:05"
},