|
|
@ -475,17 +475,19 @@ namespace Jellyfin.Server
|
|
|
|
Serilog.Log.Logger = new LoggerConfiguration()
|
|
|
|
Serilog.Log.Logger = new LoggerConfiguration()
|
|
|
|
.ReadFrom.Configuration(configuration)
|
|
|
|
.ReadFrom.Configuration(configuration)
|
|
|
|
.Enrich.FromLogContext()
|
|
|
|
.Enrich.FromLogContext()
|
|
|
|
|
|
|
|
.Enrich.WithThreadId()
|
|
|
|
.CreateLogger();
|
|
|
|
.CreateLogger();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Serilog.Log.Logger = new LoggerConfiguration()
|
|
|
|
Serilog.Log.Logger = new LoggerConfiguration()
|
|
|
|
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}")
|
|
|
|
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss}] [{Level:u3}] {ThreadId} {SourceContext}: {Message:lj} {NewLine}{Exception}")
|
|
|
|
.WriteTo.Async(x => x.File(
|
|
|
|
.WriteTo.Async(x => x.File(
|
|
|
|
Path.Combine(appPaths.LogDirectoryPath, "log_.log"),
|
|
|
|
Path.Combine(appPaths.LogDirectoryPath, "log_.log"),
|
|
|
|
rollingInterval: RollingInterval.Day,
|
|
|
|
rollingInterval: RollingInterval.Day,
|
|
|
|
outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}"))
|
|
|
|
outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {ThreadId} {SourceContext}:{Message} {NewLine}{Exception}"))
|
|
|
|
.Enrich.FromLogContext()
|
|
|
|
.Enrich.FromLogContext()
|
|
|
|
|
|
|
|
.Enrich.WithThreadId()
|
|
|
|
.CreateLogger();
|
|
|
|
.CreateLogger();
|
|
|
|
|
|
|
|
|
|
|
|
Serilog.Log.Logger.Fatal(ex, "Failed to create/read logger configuration");
|
|
|
|
Serilog.Log.Logger.Fatal(ex, "Failed to create/read logger configuration");
|
|
|
|