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 Marc Hoffmann <ma...@yahoo.com> on 2005/02/09 01:49:08 UTC

Separate log records into different files by log level

I have tried to search the forum for this topic, but with no luck, so I am posting a (hopefully)
new question.

I am trying to use log4net with an ASP.Net Web Service and it works great with the FileAppender or
RollingFileAppender. However, all log records for the defined log level or above flow into the
same output file.

My ultimate goal is to direct log entries for each level to a separate log file, i.e. log entries
recorded with Log.Error() go to an ERROR.log file, Log.Debug() entries go to a DEBUG.log file,
etc., but each file only contains the log entries associated with that level.

Is that possible with log4net? And if so, how?

I have tried various combinations of things, but nothing seems to achieve that goal. Any help or
insight would be appreciated.

Thank you.

Marc