serilog-sinks-azure-analytics
serilog-sinks-azure-analytics copied to clipboard
Migrate to Serilog PeriodicBatching and increase throughput
We were running into a performance issue and when researching determined that the Serilog.Sinks.PeriodicBatching provider was a better fit for Azure Log Analytics. The overwhelming changes were to normalize the configuration with Serilog's PeriodBatching configuration.
Of note:
- EmitBatchAsync replaces WriteLogEventAsync. EmitBatchAsync is provided by and called by Serilog.
- Changes to PostDataAsync remove the need for the semaphore - it no longer modifies default properties of the client and the list it is passed is not modified by EmitBatchAsync.
- Calls to PostDataAsync are independently asynchronous and can overlap for the same batch (so sending large batches is much faster).