diff --git a/src/Ombi/Controllers/LoggingController.cs b/src/Ombi/Controllers/LoggingController.cs index 83a6b5ad9..3b2a75ad4 100644 --- a/src/Ombi/Controllers/LoggingController.cs +++ b/src/Ombi/Controllers/LoggingController.cs @@ -15,36 +15,37 @@ namespace Ombi.Controllers } private ILogger Logger { get; } + private const string Message = "Exception: {0} at {1}. Stacktrade {2}"; [HttpPost] - public void Log([FromBody]UiLoggingModel l) + public IActionResult Log([FromBody]UiLoggingModel l) { l.DateTime = DateTime.UtcNow; - var exception = new Exception(l.Description, new Exception(l.StackTrace)); - switch (l.Level) { case LogLevel.Trace: - Logger.LogTrace(new EventId(l.Id), "Exception: {0} at {1}. Stacktrade {2}", l.Description, l.Location, l.StackTrace); + Logger.LogTrace(new EventId(l.Id), Message, l.Description, l.Location, l.StackTrace); break; case LogLevel.Debug: - Logger.LogDebug(new EventId(l.Id), "Exception: {0} at {1}. Stacktrade {2}", l.Description, l.Location, l.StackTrace); + Logger.LogDebug(new EventId(l.Id), Message, l.Description, l.Location, l.StackTrace); break; case LogLevel.Information: - Logger.LogInformation(new EventId(l.Id), "Exception: {0} at {1}. Stacktrade {2}", l.Description, l.Location, l.StackTrace); + Logger.LogInformation(new EventId(l.Id), Message, l.Description, l.Location, l.StackTrace); break; case LogLevel.Warning: - Logger.LogWarning(new EventId(l.Id), "Exception: {0} at {1}. Stacktrade {2}", l.Description, l.Location, l.StackTrace); + Logger.LogWarning(new EventId(l.Id), Message, l.Description, l.Location, l.StackTrace); break; case LogLevel.Error: - Logger.LogError(new EventId(l.Id), "Exception: {0} at {1}. Stacktrade {2}", l.Description, l.Location, l.StackTrace); + Logger.LogError(new EventId(l.Id), Message, l.Description, l.Location, l.StackTrace); break; case LogLevel.Critical: - Logger.LogCritical(new EventId(l.Id), "Exception: {0} at {1}. Stacktrade {2}", l.Description, l.Location, l.StackTrace); + Logger.LogCritical(new EventId(l.Id), Message, l.Description, l.Location, l.StackTrace); break; case LogLevel.None: break; } + + return Ok(); } } } diff --git a/src/Ombi/Properties/launchSettings.json b/src/Ombi/Properties/launchSettings.json index ae7eb99e7..8cea528a3 100644 --- a/src/Ombi/Properties/launchSettings.json +++ b/src/Ombi/Properties/launchSettings.json @@ -10,7 +10,6 @@ "profiles": { "IIS Express": { "commandName": "IISExpress", - "commandLineArgs": "server.urls=http://*:3579", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development"