|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NLog.Config;
|
|
|
|
@ -15,6 +16,11 @@ namespace NzbDrone.Common.Instrumentation
|
|
|
|
|
|
|
|
|
|
LogManager.Configuration = new LoggingConfiguration();
|
|
|
|
|
|
|
|
|
|
if (Debugger.IsAttached)
|
|
|
|
|
{
|
|
|
|
|
RegisterDebugger();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RegisterExceptron();
|
|
|
|
|
|
|
|
|
|
if (updateApp)
|
|
|
|
@ -35,6 +41,18 @@ namespace NzbDrone.Common.Instrumentation
|
|
|
|
|
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("debugger", target);
|
|
|
|
|
LogManager.Configuration.LoggingRules.Add(loggingRule);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void RegisterConsole()
|
|
|
|
|
{
|
|
|
|
|
var level = LogLevel.Trace;
|
|
|
|
|