The memory usage enricher for Serilog.
To use the enricher, first install the NuGet package:
Install-Package Serilog.Enrichers.Memory
Then enrich your logging configuration:
new LoggerConfiguration()
.Enrich.WithMemoryUsage();
And finally utilise the token in your logging template:
var template = "{MemoryUsage}";
You can also enrich your logging configuration for virtual memory:
new LoggerConfiguration()
.Enrich.WithVirtualMemoryUsage();
And finally utilise the token in your logging template:
var template = "{VirtualMemoryUsage}";
Please notice VirtualMemoryUsage is not available for .NET Standard 1.3 due to Process API unavailability.
Copyright © 2017 Josh Schreuder - Provided under the Apache License, Version 2.0.