mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
fixed a bunch of things. added basic support for file scanning. logs are now avilable in the UI
This commit is contained in:
parent
c8a8fb4d62
commit
fa0af257ff
48 changed files with 914 additions and 208 deletions
40
NzbDrone.Core/Instrumentation/LogConfiguration.cs
Normal file
40
NzbDrone.Core/Instrumentation/LogConfiguration.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using Ninject;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
public static class LogConfiguration
|
||||
{
|
||||
public static void Setup()
|
||||
{
|
||||
if (Debugger.IsAttached)
|
||||
{
|
||||
LogManager.ThrowExceptions = true;
|
||||
}
|
||||
|
||||
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
|
||||
LogManager.ConfigurationReloaded += ((s, e) => BindCustomLoggers());
|
||||
BindCustomLoggers();
|
||||
}
|
||||
|
||||
private static void BindCustomLoggers()
|
||||
{
|
||||
var exTarget = new ExceptioneerTarget();
|
||||
LogManager.Configuration.AddTarget("Exceptioneer", exTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Error, exTarget));
|
||||
|
||||
var sonicTarget = CentralDispatch.NinjectKernel.Get<SubsonicTarget>();
|
||||
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Info, sonicTarget));
|
||||
|
||||
LogManager.Configuration.Reload();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue