aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-03-08 15:33:15 -0400
committerGitHub <noreply@github.com>2020-03-08 15:33:15 -0400
commitd8d37671ff0a009a106320c20851c78f5c666747 (patch)
tree1668c83d55c733108c1fa027ff76af7bbda9eebf /Jellyfin.Server/Program.cs
parent86190aa7e995c490509e65159e4c1f76cda61cc3 (diff)
parent9e89cbbc3ad451b510a00fd7e214f6b942176f47 (diff)
Merge pull request #2535 from mark-monteiro/logging-migration
Create Logging Configuration Heirarchy
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 027186105..7c3d0f277 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -39,9 +39,14 @@ namespace Jellyfin.Server
public static class Program
{
/// <summary>
- /// The name of logging configuration file.
+ /// The name of logging configuration file containing application defaults.
/// </summary>
- public static readonly string LoggingConfigFile = "logging.json";
+ public static readonly string LoggingConfigFileDefault = "logging.default.json";
+
+ /// <summary>
+ /// The name of the logging configuration file containing the system-specific override settings.
+ /// </summary>
+ public static readonly string LoggingConfigFileSystem = "logging.json";
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory();
@@ -443,7 +448,7 @@ namespace Jellyfin.Server
private static async Task<IConfiguration> CreateConfiguration(IApplicationPaths appPaths)
{
const string ResourcePath = "Jellyfin.Server.Resources.Configuration.logging.json";
- string configPath = Path.Combine(appPaths.ConfigurationDirectoryPath, LoggingConfigFile);
+ string configPath = Path.Combine(appPaths.ConfigurationDirectoryPath, LoggingConfigFileDefault);
if (!File.Exists(configPath))
{
@@ -465,7 +470,8 @@ namespace Jellyfin.Server
return new ConfigurationBuilder()
.SetBasePath(appPaths.ConfigurationDirectoryPath)
.AddInMemoryCollection(ConfigurationOptions.Configuration)
- .AddJsonFile(LoggingConfigFile, false, true)
+ .AddJsonFile(LoggingConfigFileDefault, optional: false, reloadOnChange: true)
+ .AddJsonFile(LoggingConfigFileSystem, optional: true, reloadOnChange: true)
.AddEnvironmentVariables("JELLYFIN_")
.Build();
}