All our log data is centralized using a combination of Serilog and Seq.
Last week we got a warning that our disks were filling up. We first cleaned up some old log data but than started to look at other ways to decrease our log size.
One of the solutions we found was Serilog.Formatting.Compact.
From the documentation:
A simple, compact JSON-based event format for Serilog.
CompactJsonFormatter
significantly reduces the byte count of small log events when compared with Serilog's defaultJsonFormatter
, while remaining human-readable. It achieves this through shorter built-in property names, a leaner format, and by excluding redundant information.
Seq starting from version 3.3 accepts this more compact format. To use this, configure the sink with compact: true
:
.WriteTo.Seq("http://localhost:5341", compact: true)