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 enoesque <en...@yahoo.co.uk> on 2009/03/05 17:58:05 UTC

Adding a logger stops another one from working...!?

Hi,

I'm new to log4net, and I'm having a problem with multiple loggers.
	
I had an AdoNetAppender logger in my config file, and it worked fine,
logging issues to a database.

I then added another logger, to log other ERRORS to a text file.  This
actually stopped my AdoNetAppender from logging to my database.

The configs are below - am I missing something obvious?

Thanks

eno

<!-- ADDING THIS LOGGER STOPS THE LOGGER BELOW FROM WORKING.
ErrorFileAppender is a RollingFileAppender -->
    <logger name="App.ns1.Common.Utilities" additivity="true"> 
      <level value="ERROR"/>
      <appender-ref ref="ErrorFileAppender"/>
    </logger>

<!-- THIS LOGGER WORKS UNTIL I ADD THE LOGGER ABOVE -->
    <logger name="App.ns1" additivity="true"> 
      <level value="INFO"/>
      <appender-ref ref="AdoNetAppender"/>
    </logger>


-- 
View this message in context: http://www.nabble.com/Adding-a-logger-stops-another-one-from-working...%21--tp22355768p22355768.html
Sent from the Log4net - Users mailing list archive at Nabble.com.


Re: Adding a logger stops another one from working...!?

Posted by enoesque <en...@yahoo.co.uk>.
Couldn't get this working so I ended up logging both using the
AdoNetAppender.

eno


enoesque wrote:
> 
> Hi,
> 
> I'm new to log4net, and I'm having a problem with multiple loggers.
> 	
> I had an AdoNetAppender logger in my config file, and it worked fine,
> logging issues to a database.
> 
> I then added another logger, to log other ERRORS to a text file.  This
> actually stopped my AdoNetAppender from logging to my database.
> 
> The configs are below - am I missing something obvious?
> 
> Thanks
> 
> eno
> 
> <!-- ADDING THIS LOGGER STOPS THE LOGGER BELOW FROM WORKING.
> ErrorFileAppender is a RollingFileAppender -->
>     <logger name="App.ns1.Common.Utilities" additivity="true"> 
>       <level value="ERROR"/>
>       <appender-ref ref="ErrorFileAppender"/>
>     </logger>
> 
> <!-- THIS LOGGER WORKS UNTIL I ADD THE LOGGER ABOVE -->
>     <logger name="App.ns1" additivity="true"> 
>       <level value="INFO"/>
>       <appender-ref ref="AdoNetAppender"/>
>     </logger>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-a-logger-stops-another-one-from-working...%21--tp22355768p22374983.html
Sent from the Log4net - Users mailing list archive at Nabble.com.