Closed chrisfink closed 4 years ago
Hi Chris, thanks for getting in touch!
In your stress test, it looks like you're constructing and tearing down the whole logging pipeline on every iteration, which will block while asychronously-batched events are flushed across the network.
To fix this, the logging pipeline should be constructed only once at app start-up, i.e. LoggerConfiguration.CreateLogger()
, and torn down only on a clean application exit (Log.CloseAndFlush()
).
Let me know if this helps, Nick
If you're still hitting issues in your testing, please drop me a line - closing this one as stale for now. Cheers!
When logging to SEQ using Serilog, I am seeing average execution times between 150 and 200ms which seems very high to me.
I have attached a test tool which I am using to produce these results. I have hidden the SEQ URL; but SEQ is within our network and running on adequate hardware. I have also pared down the logging to a bare minimum to try to isolate any issues by removing our enrichers and turning off the selflog to diagnose any issues.
As you can see in the example, the logging is bared boned and still taking 150ms plus. My understanding is that Serilog is async out of the box which brings up a few questions.
Appreciate any feedback you can provide. Performance is critical before we push this logging to production and these metrics are a big blocker for us at the moment.
Thank you!
SerilogStressTest.txt