[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4net-user
Subject:    RE: Where to put config info
From:       pantichd () firstenergycorp ! com
Date:       2004-06-09 13:04:02
Message-ID: OFB5F3A966.F988D70A-ON85256EAE.0047B9E9-85256EAE.0047C7B6 () fenetwork ! com
[Download RAW message or body]


Nicko,

That worked GREAT.  Thanks a lot for your help!


David



                                                                                      \
                
                      Nicko Cadell                                                    \
                
                      <nicko@neoworks.c        To:       "'Log4NET User'" \
                <log4net-user@logging.apache.org>                                     \
                
                      om>                      cc:                                    \
                
                                               Subject:  RE: Where to put config info \
                
                      06/09/2004 03:47                                                \
                
                      AM                                                              \
                
                      Please respond to                                               \
                
                      "Log4NET User"                                                  \
                
                                                                                      \
                
                                                                                      \





David,

The web app sets the following attribute in the Global.cs file:

// Load the configuration from the 'WebApp.dll.log4net' file
[assembly: log4net.Config.DOMConfigurator(ConfigFileExtension="log4net",
Watch=true)]

If you change this to

[assembly: log4net.Config.DOMConfigurator()]

then the configuration will be loaded from the applications .config file.
In
the case of an APS.NET app this will be the Web.config.


Remember you need to register a configuration section handler in the
.config
file otherwise .net configuration system will get upset:

<!-- Register a section handler for the log4net section -->
<configSections>
  <section name="log4net" type="System.Configuration.IgnoreSectionHandler"
/>
</configSections>

Cheers,

Nicko

> -----Original Message-----
> From: pantichd@firstenergycorp.com
> [mailto:pantichd@firstenergycorp.com]
> Sent: 09 June 2004 04:13
> To: Log4NET User
> Subject: Where to put config info
> 
> Hello,
> 
> Just getting started with log4net so please be patient with
> what may be a simple question for those of you more
> experienced than me.
> 
> When I first started looking at log4net the examples I saw
> had the configuration information in the Web.config file.
> Then I downloaded version 1.2.0 beta8 and I can't seem to get
> it to work with the config info in the Web.config file. The
> example has the information in the Webapp.dll.log4net file.
> 
> I'd prefer to have the log4net config info in the Web.config
> file. Is that still possible? If so, is there something
> special I have to do?
> 
> Thanks in advance for any help.
> 
> David
> 
> 
> 
> -----------------------------------------
> The information contained in this message is intended only
> for the personal and confidential use of the recipient(s)
> named above. If the reader of this message is not the
> intended recipient or an agent responsible for delivering it
> to the intended recipient, you are hereby notified that you
> have received this document in error and that any review,
> dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication
> in error, please notify us immediately, and delete the
> original message.
> 






-----------------------------------------
The information contained in this message is intended only for the personal and \
confidential use of the recipient(s) named above. If the reader of this message is \
not the intended recipient or an agent responsible for delivering it to the intended \
recipient, you are hereby notified that you have received this document in error and \
that any review, dissemination, distribution, or copying of this message is strictly \
prohibited. If you have received this communication in error, please notify us \
immediately, and delete the original message.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic