Description
In a process I have multiple threads, each thread is creating a file with same log entries resulting in creation of multiple duplicate files within a process. This happens when multiple threads are trying to log same time.
I am using RollingFIleAppender
RollingFileAppender appender = new RollingFileAppender
KB",
StaticLogFileName = false,
File = "myFile[%processid].log"
};
Upon digging turns out log4Net is thread safe but not process safe
https://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe/17
Tried multiple locking mechanism which are offered by Log4Net itself for RollingFileAppender MinimalLock, InterProcessLock and ExclusiveLock none of them helped. Nor does PatterString help.
Any ideas on how to solve the issue?