mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
Improve logging performance
Perform logging to file on a background thread. This means logging won't be bottlenecked by IO.
This commit is contained in:
@@ -173,10 +173,10 @@ namespace Jellyfin.Server
|
||||
{
|
||||
Serilog.Log.Logger = new LoggerConfiguration()
|
||||
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}")
|
||||
.WriteTo.File(
|
||||
.WriteTo.Async(x => x.File(
|
||||
Path.Combine(appPaths.LogDirectoryPath, "log_.log"),
|
||||
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}] {Message}{NewLine}{Exception}"))
|
||||
.Enrich.FromLogContext()
|
||||
.CreateLogger();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user