Search code examples
azureasp.net-web-apilog4netnlogelmah

WebApi custom log and Azure Storage


I'm using Log4net to log WebApi controllers method call to log method info, execution duration and exceptions in log files (I can change it to Elmah or NLog). I also have some custom message logs which are written by developers. All the log files resides on the same web server and if I want to analyse them, I should move them to the other machine.

Is there any way to write them directly to Azure Storage and which storage type (Blob/Table/File) is the best one?

Thanks


Solution

  • You should probably look into the Azure appender for log4net: http://stemarie.github.io/log4net.Azure/. It works with both blob storage and table storage. I would choose to save to table storage, since you will have some basic search capabilities on top of that, not available on blob storage.

    Both ELMAH and NLog have similar features for logging to Azure storage.