mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 23:13:06 +03:00
Use dependency injection to construct migration routines
This commit is contained in:
@@ -36,6 +36,13 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
@"{""Serilog"":{""MinimumLevel"":""Information"",""WriteTo"":[{""Name"":""Console"",""Args"":{""outputTemplate"":""[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}""}},{""Name"":""Async"",""Args"":{""configure"":[{""Name"":""File"",""Args"":{""path"":""%JELLYFIN_LOG_DIR%//log_.log"",""rollingInterval"":""Day"",""retainedFileCountLimit"":3,""rollOnFileSizeLimit"":true,""fileSizeLimitBytes"":100000000,""outputTemplate"":""[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] [{ThreadId}] {SourceContext}:{Message}{NewLine}{Exception}""}}]}}],""Enrich"":[""FromLogContext"",""WithThreadId""]}}",
|
||||
};
|
||||
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
|
||||
public CreateUserLoggingConfigFile(IApplicationPaths appPaths)
|
||||
{
|
||||
_appPaths = appPaths;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Guid Id => Guid.Parse("{EF103419-8451-40D8-9F34-D1A8E93A1679}");
|
||||
|
||||
@@ -43,9 +50,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
public string Name => "CreateLoggingConfigHeirarchy";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform(CoreAppHost host, ILogger logger)
|
||||
public void Perform()
|
||||
{
|
||||
var logDirectory = host.Resolve<IApplicationPaths>().ConfigurationDirectoryPath;
|
||||
var logDirectory = _appPaths.ConfigurationDirectoryPath;
|
||||
var existingConfigPath = Path.Combine(logDirectory, "logging.json");
|
||||
|
||||
// If the existing logging.json config file is unmodified, then 'reset' it by moving it to 'logging.old.json'
|
||||
|
||||
Reference in New Issue
Block a user