|
|
@ -26,6 +26,8 @@
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Data;
|
|
|
|
using System.Data;
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
|
@ -96,12 +98,12 @@ namespace PlexRequests.Helpers
|
|
|
|
// Step 4. Define rules
|
|
|
|
// Step 4. Define rules
|
|
|
|
var rule1 = new LoggingRule("*", LogLevel.Debug, databaseTarget);
|
|
|
|
var rule1 = new LoggingRule("*", LogLevel.Debug, databaseTarget);
|
|
|
|
config.LoggingRules.Add(rule1);
|
|
|
|
config.LoggingRules.Add(rule1);
|
|
|
|
|
|
|
|
var currentPath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty, "logs/${shortdate}.log");
|
|
|
|
|
|
|
|
|
|
|
|
var fileTarget = new FileTarget
|
|
|
|
var fileTarget = new FileTarget
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Name = "file",
|
|
|
|
Name = "file",
|
|
|
|
FileName = "logs/${shortdate}.log",
|
|
|
|
FileName = currentPath,
|
|
|
|
Layout = "${date} ${logger} ${level}: ${message} ${exception:tostring}",
|
|
|
|
Layout = "${date} ${logger} ${level}: ${message} ${exception:tostring}",
|
|
|
|
CreateDirs = true
|
|
|
|
CreateDirs = true
|
|
|
|
};
|
|
|
|
};
|
|
|
|