logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaun Lipscombe <shaun.lipsco...@gmsl.co.uk>
Subject Re: Where to load configuration
Date Thu, 22 Jun 2006 08:39:05 GMT
* Ron Grabowski wrote:
> By service, do you mean a Win32 Service? Does the service continue to
> run when the website is offline?

Yes I mean a service that runs independentaly to the web site and will
continue to run even should the website be unavailable (since it will
never be intentionally offline).

What I've done is I've put a XmlConfigurator.Configure() in the
globals.asax because I want

- logging for the site, even before any objects that contain logging are
created, plus I want those objects to have access to the static
LogManager configured by the site.

- logging for ALL sites regardless of whether those sites create objects
that contain logging.

and I've put another XmlConfigurator.Configure() (using the same XML
configuration file) in the constructor for the service.  Ideally I
wanted to just have XmlConfigurator.Configure() in one place but the
scope of the LogManager is AppDomain-wide isn't it?  What problems will
there be, if any, with the way I've configured log4net?

Can it be done in any better way or is it OK like this?

Many thanks,


View raw message