2013-05-20 00:30:02 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NLog.Config;
|
|
|
|
|
using NLog.LayoutRenderers;
|
2013-06-28 00:04:52 +00:00
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-05-20 00:30:02 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Instrumentation
|
|
|
|
|
{
|
|
|
|
|
[ThreadAgnostic]
|
|
|
|
|
[LayoutRenderer("appLog")]
|
|
|
|
|
public class ApplicationLogLayoutRenderer : LayoutRenderer
|
|
|
|
|
{
|
|
|
|
|
private readonly string _appData;
|
|
|
|
|
|
|
|
|
|
public ApplicationLogLayoutRenderer()
|
|
|
|
|
{
|
2013-08-13 05:08:37 +00:00
|
|
|
|
_appData = Path.Combine(new AppFolderInfo(new DiskProvider(), StartupArguments.Instance ).GetLogFolder(), "nzbdrone.txt");
|
2013-05-20 00:30:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Append(StringBuilder builder, LogEventInfo logEvent)
|
|
|
|
|
{
|
|
|
|
|
builder.Append(_appData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|