1
votes

I have an issue where I am using log4net to attempt to log to blog storage. I have log4net debugging enabled and can see there are no errors:

log4net: Loading Appender [BlobAppender] type: [log4net.Appender.AzureBlobAppender, log4net.Appender.Azure]
log4net: Setting Property [ContainerName] to String value [testloggingblob]
log4net: Setting Property [DirectoryName] to String value [logs]
log4net: Setting Property [ConnectionString] to String value [UseDevelopmentStorage=true]
log4net: Created Appender [BlobAppender]
log4net: Adding appender named [BlobAppender] to logger [ProductionLogger].

I am logging to:

UseDevelopmentStorage=true

The container gets created but nothing gets logged:

Here is my config:

my app.config

Here is my container that was created when I ran my code:

generated blob in cloud explorer

Any help would be great.

thanks

1
What's your buffer size setting for the appender? By default it's 512 so 512 logging events would have to occur before being written to the blob. You can change the setting to a much smaller amount to make it write more often. Something like <bufferSize value="5" />Casey
@casey. My buffer is set to 1. Could it be something else?RuSs
Nothing is immediately coming to mind. It's likely a configuration issue. You have the the log4net.internal.debug app setting configured? And your buffersize is configured in the blob appender config? The image in your question doesn't show it being there. You're also making sure your application is logging? I would add a simple Info log to some common area of the application you could force to fire.Casey
@casey. Will investigate and get back to youRuSs
@Casey I have marked your comment UP as it was the right answer. I Didnt have a buffer setting on my log4net.Appender.AzureBlobAppender. If you like, answer the question instead of writing a comment and I will make it as the answer. Cheers RussRuSs

1 Answers

3
votes

Make sure your bufferSize is small enough that you can force it to write to the blob trivially while developing. By default it's 512 so 512 logging events would have to occur before being written to the blob.

You can change the setting to a much smaller amount to make it write more often. Something like

<bufferSize value="5" />