Files
SteamWare/SteamWare.Logger/Logging.cs
T
Samuele E. Locatelli 8fc17f44ea Fix classe logging NLog
2020-02-20 16:12:37 +01:00

38 lines
912 B
C#

using NLog;
using NLog.Config;
using NLog.Targets;
namespace SteamWare.Logger
{
/// <summary>
/// Classe helper x LOG basata su NLog
/// </summary>
public static class Logging
{
/// <summary>
/// S
/// </summary>
public static NLog.Logger Instance { get; private set; }
static Logging()
{
#if DEBUG
// Setup the logging view for Sentinel - http://sentinel.codeplex.com
var sentinalTarget = new NLogViewerTarget()
{
Name = "sentinal",
Address = "udp://127.0.0.1:9999",
IncludeNLogData = false
};
var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget);
LogManager.Configuration.AddTarget("sentinal", sentinalTarget);
LogManager.Configuration.LoggingRules.Add(sentinalRule);
#endif
LogManager.ReconfigExistingLoggers();
Instance = LogManager.GetCurrentClassLogger();
}
}
}