aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-06-19 10:49:49 -0600
committercrobibero <cody@robibe.ro>2020-06-19 10:49:49 -0600
commit494f6970724f3243ed5a6ebe89d756bf2759d3eb (patch)
tree3b46944461c30fb750170534d15dc90ffa386be0 /Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
parent000088f8f94e24ea715f15b722a2e64958bec07b (diff)
parent305808dd0ac4f86bb1663e7f6ba2b22064ace0ba (diff)
Merge remote-tracking branch 'upstream/api-migration' into api-library
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs')
-rw-r--r--Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs b/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
index 3bc32c047..b15e09290 100644
--- a/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
+++ b/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using MediaBrowser.Common.Configuration;
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
namespace Jellyfin.Server.Migrations.Routines
@@ -36,6 +35,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 +49,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'