wiredup db logging.

This commit is contained in:
kay.one 2013-05-20 20:20:29 -07:00
commit af4063c3e2
6 changed files with 31 additions and 6 deletions

View file

@ -3,7 +3,6 @@ using NLog.Config;
using NLog;
using NLog.Layouts;
using NLog.Targets;
using NzbDrone.Common;
namespace NzbDrone.Core.Instrumentation
{
@ -21,12 +20,17 @@ namespace NzbDrone.Core.Instrumentation
{
Layout = new SimpleLayout("${callsite:className=false:fileName=false:includeSourcePath=false:methodName=true}");
Rule = new LoggingRule("*", LogLevel.Debug, this);
LogManager.Configuration.AddTarget("DbLogger", this);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, this));
LogManager.Configuration.LoggingRules.Add(Rule);
LogManager.ConfigurationReloaded += (sender, args) => Register();
LogManager.ReconfigExistingLoggers();
}
public LoggingRule Rule { get; set; }
protected override void Write(LogEventInfo logEvent)
{
var log = new Log();