1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-31 19:32:51 +00:00
Lidarr/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs
2012-02-15 21:14:01 -08:00

29 lines
No EOL
826 B
C#

using System.Linq;
using System.Web.Hosting;
using NLog;
using NzbDrone.Common;
using NzbDrone.Services.Service.App_Start;
[assembly: WebActivator.PreApplicationStartMethod(typeof(Logging), "PreStart")]
namespace NzbDrone.Services.Service.App_Start
{
public static class Logging
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public static void PreStart()
{
string logPath = string.Format("C:\\NLog\\{0}\\{1}\\${{shortdate}}.log", HostingEnvironment.SiteName, new EnviromentProvider().Version);
LogConfiguration.RegisterUdpLogger();
LogConfiguration.RegisterFileLogger(logPath, LogLevel.Trace);
LogConfiguration.Reload();
logger.Info("Logger has been configured. (App Start)");
}
}
}