1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed logging exceptions

This commit is contained in:
Uncled1023 2019-08-08 23:22:59 -07:00
parent b5d5e4afbe
commit 2bb06b097c
5 changed files with 39 additions and 40 deletions

View File

@ -11,7 +11,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish>https://auth.teknik.io/</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ProjectGuid>eb46e1eb-fdc2-4168-a0ad-8b284d44b13e</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>true</_IsPortable>

View File

@ -225,7 +225,7 @@ User Message:
message += " | User Agent: " + Request.Headers["User-Agent"].ToString();
}
_logger.Log(level, message, exception);
_logger.Log(level, exception, message);
}
}
}

View File

@ -45,7 +45,6 @@ namespace Teknik.Middleware
}
catch (Exception ex)
{
httpContext.Response.StatusCode = 500;
exception = ex;
}
@ -78,7 +77,7 @@ namespace Teknik.Middleware
ErrorController errorController = new ErrorController(logger, config, dbContext);
errorController.ControllerContext = context;
if (httpContext.Response.StatusCode == 500)
if (httpContext.Response.StatusCode == 500 || exception != null)
{
await errorController.Http500(exception).ExecuteResultAsync(context);
}

View File

@ -11,7 +11,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish>https://www.teknik.io/</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ProjectGuid>1e52f0d0-9e89-4022-a905-c685ef3564e1</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>true</_IsPortable>

View File

@ -1,38 +1,38 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:23818",
"sslPort": 44362
}
},
"profiles": {
"TeknikCore": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "?sub=www",
"environmentVariables": {
"ASPNETCORE_URLS": "https://localhost:5050",
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Teknik - Prod": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "?sub=www",
"environmentVariables": {
"ASPNETCORE_URLS": "https://localhost:5050",
"ASPNETCORE_ENVIRONMENT": "Production"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_HTTPS_PORT": "44362",
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:23818",
"sslPort": 44362
}
},
"profiles": {
"TeknikCore": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "?sub=www",
"environmentVariables": {
"ASPNETCORE_URLS": "https://localhost:8050",
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Teknik - Prod": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "?sub=www",
"environmentVariables": {
"ASPNETCORE_URLS": "https://localhost:5050",
"ASPNETCORE_ENVIRONMENT": "Production"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_HTTPS_PORT": "44362",
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}