mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
Enabled rolling file logging.
This commit is contained in:
parent
5e3e071692
commit
d1e3298da1
17 changed files with 817 additions and 185 deletions
28
NzbDrone.Web/App_Start/Logging.cs
Normal file
28
NzbDrone.Web/App_Start/Logging.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NzbDrone.Common;
|
||||
|
||||
[assembly: WebActivator.PreApplicationStartMethod(typeof(NzbDrone.Web.App_Start.Logging), "PreStart")]
|
||||
|
||||
namespace NzbDrone.Web.App_Start
|
||||
{
|
||||
|
||||
public static class Logging
|
||||
{
|
||||
public static void PreStart()
|
||||
{
|
||||
var enviromentProvider = new EnviromentProvider();
|
||||
|
||||
LogManager.Configuration = new XmlLoggingConfiguration(enviromentProvider.GetNlogConfigPath(), false);
|
||||
|
||||
LogConfiguration.RegisterUdpLogger();
|
||||
LogConfiguration.RegisterExceptioneer();
|
||||
LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Web.MvcApplication");
|
||||
LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Core.CentralDispatch");
|
||||
LogConfiguration.RegisterRollingFileLogger(enviromentProvider.GetLogFileName(), LogLevel.Trace);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue