mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
parent
f55c19da6f
commit
69d75976c5
2 changed files with 10 additions and 10 deletions
|
@ -15,36 +15,37 @@ namespace Ombi.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
private ILogger Logger { get; }
|
private ILogger Logger { get; }
|
||||||
|
private const string Message = "Exception: {0} at {1}. Stacktrade {2}";
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Log([FromBody]UiLoggingModel l)
|
public IActionResult Log([FromBody]UiLoggingModel l)
|
||||||
{
|
{
|
||||||
l.DateTime = DateTime.UtcNow;
|
l.DateTime = DateTime.UtcNow;
|
||||||
var exception = new Exception(l.Description, new Exception(l.StackTrace));
|
|
||||||
|
|
||||||
switch (l.Level)
|
switch (l.Level)
|
||||||
{
|
{
|
||||||
case LogLevel.Trace:
|
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;
|
break;
|
||||||
case LogLevel.Debug:
|
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;
|
break;
|
||||||
case LogLevel.Information:
|
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;
|
break;
|
||||||
case LogLevel.Warning:
|
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;
|
break;
|
||||||
case LogLevel.Error:
|
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;
|
break;
|
||||||
case LogLevel.Critical:
|
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;
|
break;
|
||||||
case LogLevel.None:
|
case LogLevel.None:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
"commandLineArgs": "server.urls=http://*:3579",
|
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue