serilog | aspnet-core | logging

Serilog - Console Sink Themes

Curious about how each theme in Serilog.Sinks.Console looks like? Check them here.

Abhith Rajan
Abhith RajanJune 20, 2020 · 1 min read · Last Updated:

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
SystemConsoleTheme.Literate

ConsoleTheme.None

.WriteTo.Console(theme: ConsoleTheme.None)
ConsoleTheme.None
ConsoleTheme.None

SystemConsoleTheme.Grayscale

.WriteTo.Console(theme: SystemConsoleTheme.Grayscale)
SystemConsoleTheme.Grayscale
SystemConsoleTheme.Grayscale

AnsiConsoleTheme.Literate

.WriteTo.Console(theme: AnsiConsoleTheme.Literate)
AnsiConsoleTheme.Literate
AnsiConsoleTheme.Literate

AnsiConsoleTheme.Grayscale

.WriteTo.Console(theme: AnsiConsoleTheme.Grayscale)
AnsiConsoleTheme.Grayscale
AnsiConsoleTheme.Grayscale

AnsiConsoleTheme.Code

.WriteTo.Console(theme: AnsiConsoleTheme.Code)
AnsiConsoleTheme.Code
AnsiConsoleTheme.Code

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 👇

Additional Resources

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub


Abhith Rajan

Written byAbhith Rajan
Abhith Rajan is a software engineer by day and a full-stack developer by night. He's coding for almost a decade now. He codes 🧑‍💻, write ✍️, learn 📖 and advocate 👍.
Connect

Webmentions

Is this page helpful?

Related ArticlesView All

Related VideosView All

Why I DON'T use MediatR in ASP.NET Core

Don't Use AutoMapper in C#! Do THIS Instead!

Exploring Source Generation for Logging

Related StoriesView All

Related Tools & ServicesView All

flurl.dev

Flurl

Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library for .NET.