26 lines
845 B
C#
26 lines
845 B
C#
using DigitalData.Modules.Logging;
|
|
|
|
namespace EnvelopeGenerator.Web.Services
|
|
{
|
|
public class LoggingService
|
|
{
|
|
public LogConfig LogConfig { get; set; }
|
|
|
|
public LoggingService(IConfiguration Config)
|
|
{
|
|
LogConfig = new LogConfig(LogConfig.PathType.CustomPath, Config["Config:LogPath"], null, "Digital Data", "ECM.EnvelopeGenerator.Web");
|
|
|
|
var logger = LogConfig.GetLogger();
|
|
logger.Info("Logging initialized!");
|
|
|
|
var debugLog = bool.Parse(Config["Config:LogDebug"]);
|
|
logger.Info("Setting DEBUG Logging to: [{0}]", debugLog);
|
|
LogConfig.Debug = debugLog;
|
|
|
|
var jsonLog = bool.Parse(Config["Config:LogJson"]);
|
|
logger.Info("Setting JSON Logging to: [{0}]", jsonLog);
|
|
LogConfig.Debug = jsonLog;
|
|
}
|
|
}
|
|
}
|