Serilog is my favorite logger. The sinks I was using are ApplicationInsights, File, and Seq (for local). I was not using Console sink but when we switched to docker
, I thought it is nice to have Console too.
I was checking the colored output for Console and I realized that the serilog-sinks-coloredconsole
is retired and the Serilog.Sinks.Console
by default has the colored output. There were few color themes listed on the readme so I want to see how each looks like, and see it for yourself below.
Built-in Themes
SystemConsoleTheme.Literate (Default)
.WriteTo.Console()
OR
.WriteTo.Console(theme: SystemConsoleTheme.Literate)
![SystemConsoleTheme.Literate](/static/2a88de4a10e783d31e99f1e778c2d607/f0145/SystemConsoleTheme.Literate.png)
ConsoleTheme.None
.WriteTo.Console(theme: ConsoleTheme.None)
![ConsoleTheme.None](/static/5743121478d0ce064d6b9ec08d765f82/08065/ConsoleTheme.None.png)
SystemConsoleTheme.Grayscale
.WriteTo.Console(theme: SystemConsoleTheme.Grayscale)
![SystemConsoleTheme.Grayscale](/static/5ed8043fb24a93cee30aac3ab07531b7/6014e/SystemConsoleTheme.Grayscale.png)
AnsiConsoleTheme.Literate
.WriteTo.Console(theme: AnsiConsoleTheme.Literate)
![AnsiConsoleTheme.Literate](/static/148a2842203ab5c3ac118fc66219ffc3/f0145/AnsiConsoleTheme.Literate.png)
AnsiConsoleTheme.Grayscale
.WriteTo.Console(theme: AnsiConsoleTheme.Grayscale)
![AnsiConsoleTheme.Grayscale](/static/22c1997f5baf1b22da324db164b4badb/fe639/AnsiConsoleTheme.Grayscale.png)
AnsiConsoleTheme.Code
.WriteTo.Console(theme: AnsiConsoleTheme.Code)
![AnsiConsoleTheme.Code](/static/868bbba82a5770cd02600600300b05e2/f0145/AnsiConsoleTheme.Code.png)
Final Notes
In the above list, my favorite so far is the default
one. I didn’t try any custom themes yet. if you know any good looking custom themes, let me know in the comments 👇