From 89dba91f3a9281f07e1eca16ce1571e94c218b1a Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 15 Feb 2012 21:14:01 -0800 Subject: [PATCH] trying to fix nlog for nzbdrone services --- .../NzbDrone.Services.Service/App_Start/Logging.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs b/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs index 3d453defc..cdae09e7b 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Web.Hosting; using NLog; using NzbDrone.Common; using NzbDrone.Services.Service.App_Start; @@ -14,13 +15,15 @@ namespace NzbDrone.Services.Service.App_Start public static void PreStart() { + string logPath = string.Format("C:\\NLog\\{0}\\{1}\\${{shortdate}}.log", HostingEnvironment.SiteName, new EnviromentProvider().Version); + LogConfiguration.RegisterUdpLogger(); - LogConfiguration.RegisterFileLogger("${basedir}/_logs/${shortdate}.log", LogLevel.Trace); + LogConfiguration.RegisterFileLogger(logPath, LogLevel.Trace); LogConfiguration.Reload(); logger.Info("Logger has been configured. (App Start)"); - + } } } \ No newline at end of file