|
|
@ -39,9 +39,14 @@ namespace Jellyfin.Server
|
|
|
|
public static class Program
|
|
|
|
public static class Program
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// The name of logging configuration file.
|
|
|
|
/// The name of logging configuration file containing application defaults.
|
|
|
|
/// </summary>
|
|
|
|
/// </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 user override settings.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public static readonly string LoggingConfigFileUser = "logging.user.json";
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
|
|
|
|
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
|
|
|
|
private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory();
|
|
|
|
private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory();
|
|
|
@ -443,7 +448,7 @@ namespace Jellyfin.Server
|
|
|
|
private static async Task<IConfiguration> CreateConfiguration(IApplicationPaths appPaths)
|
|
|
|
private static async Task<IConfiguration> CreateConfiguration(IApplicationPaths appPaths)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const string ResourcePath = "Jellyfin.Server.Resources.Configuration.logging.json";
|
|
|
|
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))
|
|
|
|
if (!File.Exists(configPath))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -465,7 +470,7 @@ namespace Jellyfin.Server
|
|
|
|
return new ConfigurationBuilder()
|
|
|
|
return new ConfigurationBuilder()
|
|
|
|
.SetBasePath(appPaths.ConfigurationDirectoryPath)
|
|
|
|
.SetBasePath(appPaths.ConfigurationDirectoryPath)
|
|
|
|
.AddInMemoryCollection(ConfigurationOptions.Configuration)
|
|
|
|
.AddInMemoryCollection(ConfigurationOptions.Configuration)
|
|
|
|
.AddJsonFile(LoggingConfigFile, false, true)
|
|
|
|
.AddJsonFile(LoggingConfigFileDefault, false, true)
|
|
|
|
.AddEnvironmentVariables("JELLYFIN_")
|
|
|
|
.AddEnvironmentVariables("JELLYFIN_")
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|