From ed072c229da7bc55bff124895f4a92456ee51ff1 Mon Sep 17 00:00:00 2001 From: Argo-Cloud Date: Mon, 5 Apr 2021 19:14:35 +0800 Subject: [PATCH] feat: add Exceptionless --- src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj | 1 + src/admin/Bootstrap.Admin/Startup.cs | 3 +++ src/admin/Bootstrap.Admin/appsettings.json | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj index ab67099d..647849e7 100644 --- a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -11,6 +11,7 @@ + diff --git a/src/admin/Bootstrap.Admin/Startup.cs b/src/admin/Bootstrap.Admin/Startup.cs index 491b7522..5af9f538 100644 --- a/src/admin/Bootstrap.Admin/Startup.cs +++ b/src/admin/Bootstrap.Admin/Startup.cs @@ -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(); @@ -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('/')); diff --git a/src/admin/Bootstrap.Admin/appsettings.json b/src/admin/Bootstrap.Admin/appsettings.json index e7805ebd..35bb99d6 100644 --- a/src/admin/Bootstrap.Admin/appsettings.json +++ b/src/admin/Bootstrap.Admin/appsettings.json @@ -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" },