Skip to content

Commit 170dd90

Browse files
Update README.md
thread id now more easily identifiable
1 parent 0c00d6d commit 170dd90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ An example, which also uses the Serilogs.Sinks.Async Nuget package, is below:
3232
var logger = Log.Logger = new LoggerConfiguration()
3333
.MinimumLevel.Debug()
3434
.WriteTo.Console(restrictedToMinimumLevel:Serilog.Events.LogEventLevel.Information)
35-
.WriteTo.Async(w=>w.File("..\\..\\..\\..\\logs\\SerilogLogFile.json", rollingInterval: RollingInterval.Day, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj} {ThreadId}{NewLine}{Exception}"))
35+
.WriteTo.Async(w=>w.File("..\\..\\..\\..\\logs\\SerilogLogFile.json", rollingInterval: RollingInterval.Day, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj} <{ThreadId}>{NewLine}{Exception}"))
3636
.Enrich.WithThreadId()
3737
.CreateLogger();
3838
```
3939
Which would produce an output in the log file as follows:
4040
```
41-
2018-04-05 20:40:30.222 +02:00 [ERR] The file name_of_file.svg does not exist 1
41+
2018-04-06 13:12:45.684 +02:00 [ERR] The file file_name.svg does not exist <4>
4242
```
43+
Where, <4> is an example thread id.
44+
4345
To use the enricher, first install the NuGet package:
4446

4547
```powershell

0 commit comments

Comments
 (0)