mirror of
https://github.com/Radarr/Radarr
synced 2026-01-04 22:52:31 +01:00
NLog - Added debugger target
This commit is contained in:
parent
16356b6319
commit
ff5dc6f0ce
1 changed files with 17 additions and 0 deletions
|
|
@ -15,6 +15,11 @@ public static void Register(IStartupContext startupContext, bool updateApp, bool
|
|||
|
||||
LogManager.Configuration = new LoggingConfiguration();
|
||||
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
RegisterDebugger();
|
||||
}
|
||||
|
||||
RegisterExceptron();
|
||||
|
||||
if (updateApp)
|
||||
|
|
@ -35,6 +40,18 @@ public static void Register(IStartupContext startupContext, bool updateApp, bool
|
|||
LogManager.ReconfigExistingLoggers();
|
||||
}
|
||||
|
||||
private static void RegisterDebugger()
|
||||
{
|
||||
DebuggerTarget target = new DebuggerTarget();
|
||||
target.Name = "debuggerLogger";
|
||||
target.Layout = "[${level}] [${threadid}] ${logger}: ${message} ${onexception:inner=${newline}${newline}${exception:format=ToString}${newline}}";
|
||||
|
||||
var loggingRule = new LoggingRule("*", LogLevel.Trace, target);
|
||||
LogManager.Configuration.AddTarget("console", target);
|
||||
LogManager.Configuration.LoggingRules.Add(loggingRule);
|
||||
}
|
||||
|
||||
|
||||
private static void RegisterConsole()
|
||||
{
|
||||
var level = LogLevel.Trace;
|
||||
|
|
|
|||
Loading…
Reference in a new issue