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 Pedro Checo <PC...@pacificsummitenergy.com> on 2009/07/27 17:15:08 UTC

Location of logs when FileAppender can't open a file

Hi.

Suppose that a FileAppender in use is set to log to a directory for which it has no write or create rights, what will it do, where will the log files be created?

We have a situation where, depending on the user, the process that owns the log4net logger instance will not be able to write to the designated directory for the FileAppender. In later versions of the application, we may resolve this before log4net is initialized, but our current version doesn't have that ability at present.

Regards and thank you for publishing this comprehensive library.


Regards.

Re: Location of logs when FileAppender can't open a file

Posted by Ron Grabowski <ro...@yahoo.com>.
If a logger can't write to its destination it will notify its ErrorHandler and go offline. You should be able to bring it back online by resetting its ErrorHandler and calling ActivateOptions. I don't have the source in front of me so I can't give a concrete example.




________________________________
From: Pedro Checo <PC...@pacificsummitenergy.com>
To: "log4net-user@logging.apache.org" <lo...@logging.apache.org>
Sent: Monday, July 27, 2009 11:15:08 AM
Subject: Location of logs when FileAppender can't open a file

 
Hi.
 
Suppose that a FileAppender in use is set to log to a
directory for which it has no write or create rights, what will it do, where
will the log files be created?
 
We have a situation where, depending on the user, the
process that owns the log4net logger instance will not be able to write to the
designated directory for the FileAppender. In later versions of the application,
we may resolve this before log4net is initialized, but our current version
doesn’t have that ability at present.
 
Regards and thank you for publishing this comprehensive
library.
 
 
Regards.