stemarie / log4net.Azure

log4net.Azure
MIT License
38 stars 65 forks source link

Getting "BlockCountExceedsLimit" exception while using log4net.Appender.AzureAppendBlobAppender #76

Open Karthikeyan-tv opened 6 years ago

Karthikeyan-tv commented 6 years ago

Hi @stemarie ,

I'm using log4net.Appender.AzureAppendBlobAppender to log my web app's info & errors. Sometimes I'm getting the "BlockCountExceedsLimit" exception. It is due to the append blob accepts only 50,000 block commits after that it through the exception (Conflict (409)). I have checked the code and found that it waits for the 512 log events and flush each log entry separately to the append blob. So, we can log only 50,000 log entries in a day.

Do you have any solution for this? Can we flush the 512 log entries in a single flush?

Thanks, Karthik

Karthikeyan-tv commented 6 years ago

I've changed the code to a little bit to append the blob, once the buffer reaches the threshold value (512 log entries) it'll flush in a single commit. image