Azure, Log4Net log file, FTP transfer, Response: 550

I have an ASP.NET MVC website on Azure using log4net file appender. I cannot download the log files with FileZilla because of the following error:

Response: 550 The process cannot access the file because it is being used by another process. Error: Critical file transfer error

Is there a setting on log or Azure that I can use the be able to download log files while the web application is running? I do not want to shut down web app or IIS because of that.


You could try setting the locking method on the Appender to either one of the following:

<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

or

<lockingModel type="log4net.Appender.FileAppender+InterProcessLock" />

Alternatively you could switch to using the RollingFileAppender and then only download log files that aren't currently being written to. This Appender can rotate files based on date/time or file size and can limit the number of files it creates to avoid running out of local storage space.