logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: How to log a namespace?
Date Thu, 20 Apr 2006 00:37:59 GMT
You can define additional loggers by putting one or more logger nodes
underneath the root node:

 <root>
  <level value="ALL" />
  <appender-ref ref="GeneralLogFileAppender" />
 </root>
 <logger name="IBatisNet.Common">
  <level value="DEBUG" />
  <appender-ref ref="IBatisNetFileAppender" />
 </logger>

This is the definition for IBatisNetFileAppender:

 <appender name="IBatisNetFileAppender"
type="log4net.Appender.FileAppender">
  <file value="Logs\IBatisNet.txt" />
  <layout type="log4net.Layout.PatternLayout" />
 </appender> 

--- Julien Sobrier <julien@sobrier.net> wrote:

> Hello,
> How can I restrict the logging to a namespace or a class?
> 
> My project uses several namespaces and classes, and I'd like to have
> several log files:
> * one for all classes (done)
> * other log files for just one class or just one namespace.
> 
> Thank you
> Julien
> 


Mime
View raw message