SumoLogic/sumologic-net-appenders

Buffered messages not flushed when application exits

Closed this issue · 4 comments

The title pretty much speaks for itself.

We are using the Buffered appender and have found (during some local testing) that any messages in the buffer do not get sent when the process exits.

There does not appear to be any configuration setting to control this. The best I think we can do is to reduce the duration in either MaxFlushInterval or FlushingAccuracy.

I feel like this could benefit from some Dispose logic to flush the buffer. That would at least prevent against data loss in a planned shutdown. Not much you can do if the process suddenly exits.

Perhaps I am simply missing something though.

Thanks!

Using NLog, log4net, Serilog or AspNetCore ?

@snakefoot when I posted this the problem was with log4net. Since then we have migrated half of our services to Serilog but they're containerized and just write to the console.

@guptakeshav-sumo Think this is resolved with #92 (and #93)

Yes, should be fixed now :)