You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Yuriy Baltovsky <by...@itcs.com.ua> on 2004/10/28 08:55:25 UTC

FileAppender share reading

Hi.
I am using log4net 1.2.0-beta8.
I use FileAppender to log into file. The problem arrives when I try to read
log file in order to show log entries.
As I discovered from source, log4net uses

new StreamWriter(string fileName, bool append, encoding)
call to open the file.

Is it possible to use

new StreamWriter(new FileStream(fileName, append ? FileMode.Append :
FileMode.Create, FileAccess.ReadWrite, FileShare.Read), m_encoding)
call instead.

This will allow reading from the log file. Or introduce a parameter into
FileAppender to allow share reading?
Is there some reason not to allow share reading from log file? If yes, how
one can resolve this problem?

Sincerely,
Yuriy Baltovsky