Hi, I have discovered a problem with "interprocesslock" locking model used in our project for File appender. I will appreciate if you could investigate the issue and let me know what is wrong. Maybe it is a bug within log4net dll.
ISSUE: If file appender is configured with "<lockingModel type="log4net.Appender.FileAppender+InterProcessLock" />" and "<maximumFileSize value="5MB" />" Then splitting file for each new day works fine while splitting file during a day on limit "5MB" reached crashes the whole application. If I set maximumFileSize value to another value, let us say, to "50KB" then the app crashes when log file reaches these 50KB. Previous file gets footer at the end, new file is creating and even first attempt to write to new file is always ok. However, any next attempt to write into new log file by log4net dll fails. *The issue fixes only by changing locking model from "InterProcessLock" to "MinimalLock". However, we would like to use "InterProcessLock" because it works faster and we do logging only from one single process. It is a windows service written in C# .net with multi-threading approach used. Therefore, one process with a lot of separate threads starting and stopping inside. And logging works fine every day until log file reaches the limit by value. As I said, splitting of log file on each new day does not produce any issues.* I turned on diagnostic and debug mode for log4net library. All files are attached. Configuration file is also attached. The code line that fails: if (Log.IsInfoEnabled) Log.Info("New schedule configuration is saved successfully on server."); if I have two such lines of code written within the same function and after the first one file reaches the limit then call of the second will crash the app. Best regards ------------------------------ Denis Levushkin Software Architect - H&L Lønn Mobile +47 45 83 80 69 | Switchboard +47 46 40 40 00 Visma Software AS Karenslyst Allé 56, 0277 Oslo | http://www.visma.no Stay ahead with leading cloud software This communication is intended for the person(s) named above only. It contains information that is confidential and legally privileged. If received in error, please delete this e-mail and notify the sender.
<<attachment: Debug-17012020_FileAppender_InterProcessLock.zip>>
<<attachment: Debug-17012020_FileAppender_MinimalLock.zip>>