mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Fix the log path issue #451
This commit is contained in:
parent
a3c3945540
commit
e5e1256fad
2 changed files with 9 additions and 6 deletions
|
@ -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;
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ namespace PlexRequests.Helpers
|
||||||
return dumpTarget.ToString();
|
return dumpTarget.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ConfigureLogging(string connectionString)
|
public static void ConfigureLogging(string connectionString)
|
||||||
{
|
{
|
||||||
LogManager.ThrowExceptions = true;
|
LogManager.ThrowExceptions = true;
|
||||||
// Step 1. Create configuration object
|
// Step 1. Create configuration object
|
||||||
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Runtime.Caching" />
|
<Reference Include="System.Runtime.Caching" />
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue