diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-01-05 21:11:55 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-01-05 21:11:55 +0100 |
| commit | 23267bb08f7dcc319c81cdbdaa68efb0c6ea5bc7 (patch) | |
| tree | 3c4b6c86427afbc2feb68f61732df2a872b004b2 | |
| parent | 2850ff7b8afb2ab1a35c2797f88cef1bc0de8bd9 (diff) | |
Use -logdir if env var isn't set
| -rw-r--r-- | Jellyfin.Server/Program.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index d8a746304..53eaacad0 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -124,13 +124,14 @@ namespace Jellyfin.Server }
}
programDataPath = Path.Combine(programDataPath, "jellyfin");
+ // Ensure the dir exists
Directory.CreateDirectory(programDataPath);
}
string configPath;
- if (options.ContainsOption("-configpath"))
+ if (options.ContainsOption("-configdir"))
{
- configPath = options.GetOption("-configpath");
+ configPath = options.GetOption("-configdir");
}
else
{
@@ -149,15 +150,23 @@ namespace Jellyfin.Server }
}
configPath = Path.Combine(configPath, "jellyfin");
+ // Ensure the dir exists
Directory.CreateDirectory(configPath);
}
string logDir = Environment.GetEnvironmentVariable("JELLYFIN_LOG_DIR");
if (string.IsNullOrEmpty(logDir))
{
- logDir = Path.Combine(programDataPath, "logs");
- // Ensure logDir exists
- Directory.CreateDirectory(logDir);
+ if (options.ContainsOption("-logdir"))
+ {
+ logDir = options.GetOption("-logdir");
+ }
+ else
+ {
+ logDir = Path.Combine(programDataPath, "logs");
+ // Ensure the dir exists
+ Directory.CreateDirectory(logDir);
+ }
// $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", logDir);
}
|
