So far I always used the Stopwatch class to track timings in my applications and just added the result to my log message. Until I discovered the SerilogTimings nuget package.
Usage is simple, after you have configured Serilog, you can use Operation.Time() to time an operation:
At the completion of the using
block(!), a message will be written to the log like:
[INF] Submitting payment for order-12345 completed in 456.7 ms
You can also use it directly on top of an ILogger instance:
More info about this library can be found here: https://github.com/nblumhardt/serilog-timings