Serilog is a diagnostic logging library for .NET applications. Serilog’s support for structured logging shines when instrumenting complex, distributed, and asynchronous applications and systems

  • Serilog is built from the ground up to record structured event data
  • Serilog thinks in terms of log events, not log messages. An event is made up of:
    • A timestamp recording when the event happened
    • A level describing when the event should be captured
    • A message documenting what the event represents
    • Named properties describing the event
    • Possibly an Exception object
    • Log output sample:
      • console: 11:33:01 [INF] Hello, Serilog!
      • JSON : {"@t":"2017-11-20T11:33:01.22138","@m":"Hello, Serilog!"}
  • Behind the scenes, logging statements in your application create LogEvent objects, while the sinks attached to the pipeline figure out how to record them.
  • On LogEvents, properties added through enrichment appear the same as properties originating from the message template

Overview of Serilog