diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-01-14 18:03:26 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-14 18:03:26 +0900 |
| commit | d43d39f9b88e4d4a20e3af313e97ec3606de5413 (patch) | |
| tree | 9fb80259747600e57640014a08d216946091c81d /Jellyfin.Server/Program.cs | |
| parent | facbd87cfca7ffef1760419422c2057b1ef6d501 (diff) | |
| parent | 65fe243afbcc4b596cf8726708c1965cd34b5f68 (diff) | |
Merge pull request #2272 from Bond-009/logging
Add thread ID and source to logging
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 712990a1e..8f4432797 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -475,17 +475,19 @@ namespace Jellyfin.Server Serilog.Log.Logger = new LoggerConfiguration() .ReadFrom.Configuration(configuration) .Enrich.FromLogContext() + .Enrich.WithThreadId() .CreateLogger(); } catch (Exception ex) { 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( 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}] {ThreadId} {SourceContext}:{Message} {NewLine}{Exception}")) .Enrich.FromLogContext() + .Enrich.WithThreadId() .CreateLogger(); Serilog.Log.Logger.Fatal(ex, "Failed to create/read logger configuration"); |
