logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Fiala" <dfi...@celadonlabs.com>
Subject RE: Config not honoring appender
Date Thu, 29 Jun 2006 16:29:24 GMT
You need to use the ConfigureAndWatch Method to update the configuration
with a file change.  For example...

        Dim ConfigFile As String = Server.MapPath("~") &
"\config\log4Net.config"
        XmlConfigurator.ConfigureAndWatch(New
System.IO.FileInfo(ConfigFile))

Your root logger logs to the file appender, and since all log events go to
to the root logger, it will write to both places.  It is possible to only
have the logger write to the specified log and not the root logger, but that
is not something I have wrapped my head around yet.

-----Original Message-----
From: Shaun Lipscombe [mailto:shaun.lipscombe@gmsl.co.uk] 
Sent: Thursday, June 29, 2006 11:27 AM
To: Log4NET User
Subject: Re: Config not honoring appender

* Shaun wrote:
> Here is my config.  For some reason foo.bar writes to appender A1.  
> What have I done wrong?


OK it seems to work if I restart my program (I thought the XML config file
was polled, or do you need to specify this fact when you Configure() ?)

However a slightly more curious issue is the fact that it now writes to both
appenders FileAppender and EventLogAppender for WARN level logs.
Or is this normal behaviour?




Mime
View raw message