removed loggly
This commit is contained in:
parent
54b6bfc181
commit
0359487bf7
|
@ -27,7 +27,6 @@ namespace NzbDrone.Common.Instrumentation
|
|||
|
||||
if (updateApp)
|
||||
{
|
||||
RegisterLoggly();
|
||||
RegisterUpdateFile(appFolderInfo);
|
||||
}
|
||||
else
|
||||
|
@ -127,15 +126,6 @@ namespace NzbDrone.Common.Instrumentation
|
|||
LogManager.Configuration.AddTarget("ExceptronTarget", exceptronTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(rule);
|
||||
}
|
||||
|
||||
private static void RegisterLoggly()
|
||||
{
|
||||
var logglyTarger = new LogglyTarget();
|
||||
|
||||
var rule = new LoggingRule("*", LogLevel.Trace, logglyTarger);
|
||||
|
||||
LogManager.Configuration.AddTarget("LogglyLogger", logglyTarger);
|
||||
LogManager.Configuration.LoggingRules.Add(rule);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using NLog;
|
||||
using NLog.Layouts;
|
||||
using NLog.Targets;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using Logger = Loggly.Logger;
|
||||
|
||||
namespace NzbDrone.Common.Instrumentation
|
||||
{
|
||||
public class LogglyTarget : TargetWithLayout
|
||||
{
|
||||
private Logger _logger;
|
||||
|
||||
public LogglyTarget()
|
||||
{
|
||||
Layout = new SimpleLayout("${callsite:className=false:fileName=false:includeSourcePath=false:methodName=true}");
|
||||
|
||||
}
|
||||
|
||||
protected override void InitializeTarget()
|
||||
{
|
||||
string apiKey = string.Empty;
|
||||
|
||||
if (RuntimeInfoBase.IsProduction)
|
||||
{
|
||||
apiKey = "4c4ecb69-d1b9-4e2a-b54b-b0c4cc143a95";
|
||||
}
|
||||
else
|
||||
{
|
||||
apiKey = "d344a321-b107-45c4-a548-77138f446510";
|
||||
}
|
||||
|
||||
_logger = new Logger(apiKey);
|
||||
}
|
||||
|
||||
|
||||
protected override void Write(LogEventInfo logEvent)
|
||||
{
|
||||
var dictionary = new Dictionary<string, object>();
|
||||
|
||||
if (logEvent.Exception != null)
|
||||
{
|
||||
dictionary.Add("ex", logEvent.Exception.ToString());
|
||||
dictionary.Add("extyp", logEvent.Exception.GetType().Name);
|
||||
dictionary.Add("hash", logEvent.GetHash());
|
||||
|
||||
foreach (var key in logEvent.Exception.Data.Keys)
|
||||
{
|
||||
dictionary.Add(key.ToString(), logEvent.Exception.Data[key]);
|
||||
}
|
||||
}
|
||||
|
||||
dictionary.Add("logger", logEvent.LoggerName);
|
||||
dictionary.Add("method", Layout.Render(logEvent));
|
||||
dictionary.Add("level", logEvent.Level.Name);
|
||||
dictionary.Add("message", logEvent.GetFormattedMessage());
|
||||
dictionary.Add("ver", BuildInfo.Version.ToString());
|
||||
|
||||
_logger.Log(dictionary.ToJson());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -52,9 +52,6 @@
|
|||
<Reference Include="ICSharpCode.SharpZipLib">
|
||||
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Loggly">
|
||||
<HintPath>..\packages\loggly-csharp.2.3\lib\net35\Loggly.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog">
|
||||
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -133,7 +130,6 @@
|
|||
<Compile Include="Instrumentation\Extensions\LoggerProgressExtensions.cs" />
|
||||
<Compile Include="Instrumentation\GlobalExceptionHandlers.cs" />
|
||||
<Compile Include="Instrumentation\LogEventExtensions.cs" />
|
||||
<Compile Include="Instrumentation\LogglyTarget.cs" />
|
||||
<Compile Include="Instrumentation\LogTargets.cs" />
|
||||
<Compile Include="Instrumentation\NzbDroneFileTarget.cs" />
|
||||
<Compile Include="Instrumentation\NzbDroneLogger.cs" />
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="loggly-csharp" version="2.3" targetFramework="net40" />
|
||||
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net40" />
|
||||
<package id="NLog" version="2.1.0" targetFramework="net40" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
|
||||
|
|
Loading…
Reference in New Issue