The appender locks exclusively the file by default.
I've fixed it with the following code to its OpenFile
method:
virtual protected void OpenFile(string fileName, bool
append)
{
lock(this)
{
Reset();
LogLog.Debug("FileAppender: Opening file for writing
["+fileName+"] append ["+append+"]");
// Ensure that the directory structure exists
Directory.CreateDirectory((new
FileInfo(fileName)).DirectoryName);
FileMode mode = FileMode.Create;
if (append) mode = FileMode.Append;
SetQWForFiles(new StreamWriter(
new FileStream(fileName, mode, FileAccess.Write,
FileShare.Read), m_encoding));
m_fileName = fileName;
m_appendToFile = append;
WriteHeader();
}
}
The change is about passing an specifically constructed
FileStream to StreamWriter, so we can specify the
FileShare.Read mode.
Logged In: YES
user_id=278872
Thanks, will be available in the next release.