aspnet-core | logging

Serilog - Console Sink Themes

by Abhith RajanJune 20, 2020 · 2 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)

1.WriteTo.Console()

OR

1.WriteTo.Console(theme: SystemConsoleTheme.Literate)

SystemConsoleTheme.Literate
SystemConsoleTheme.Literate

ConsoleTheme.None

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

ConsoleTheme.None
ConsoleTheme.None

SystemConsoleTheme.Grayscale

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

SystemConsoleTheme.Grayscale
SystemConsoleTheme.Grayscale

AnsiConsoleTheme.Literate

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

AnsiConsoleTheme.Literate
AnsiConsoleTheme.Literate

AnsiConsoleTheme.Grayscale

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

AnsiConsoleTheme.Grayscale
AnsiConsoleTheme.Grayscale

AnsiConsoleTheme.Code

1.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

Written by Abhith Rajan
Abhith Rajan is an aspiring software engineer with more than 7 years of experience and proven successful track record of delivering technology-based products and services.
Buy me a coffee

Was this article helpful?

Your opinion matters

Please share your thought about this article

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

Related Posts

Related Videos

Dynamically enabling features with Feature Flags in .NET Core 3.1

Fluent Bit: Solving Logging Challenges for Cloud Native Environments

Validation using MediatR's Pipeline Behaviors and FluentValidation | Clean .NET Core

Related Stories

Related Services

Flurl

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