diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-01-01 21:34:12 +0100 |
|---|---|---|
| committer | Vasily <JustAMan@users.noreply.github.com> | 2019-01-02 02:30:59 +0300 |
| commit | 95a5dd881076f6649f4b5dc5a1897df98dc3c008 (patch) | |
| tree | 84fa9b004289c6c718dabad4220ea3b446e69083 /Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs | |
| parent | 33889e53527901fb59e5dd4a6bceddeb2442d70c (diff) | |
Fix log dir
Diffstat (limited to 'Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs')
| -rw-r--r-- | Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs index 52e421374..76d0076a6 100644 --- a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs +++ b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using MediaBrowser.Common.Configuration; namespace Emby.Server.Implementations.AppBase @@ -13,10 +12,11 @@ namespace Emby.Server.Implementations.AppBase /// <summary> /// Initializes a new instance of the <see cref="BaseApplicationPaths"/> class. /// </summary> - protected BaseApplicationPaths(string programDataPath, string appFolderPath) + protected BaseApplicationPaths(string programDataPath, string appFolderPath, string logDirectoryPath) { ProgramDataPath = programDataPath; ProgramSystemPath = appFolderPath; + LogDirectoryPath = logDirectoryPath; } public string ProgramDataPath { get; private set; } @@ -107,6 +107,11 @@ namespace Emby.Server.Implementations.AppBase } /// <summary> + /// The _log directory + /// </summary> + private string _logDirectoryPath; + + /// <summary> /// Gets the path to the log directory /// </summary> /// <value>The log directory path.</value> @@ -114,7 +119,18 @@ namespace Emby.Server.Implementations.AppBase { get { - return Path.Combine(ProgramDataPath, "logs"); + if (string.IsNullOrEmpty(_logDirectoryPath)) + { + _logDirectoryPath = Path.Combine(ProgramDataPath, "logs"); + + Directory.CreateDirectory(_logDirectoryPath); + } + + return _logDirectoryPath; + } + set + { + _logDirectoryPath = value; } } |
