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 Jack Yang <jy...@logithink.com> on 2005/07/23 00:30:47 UTC

Configuration in COM+ Server Application

We are trying to use log4net (1.2.0-beta8) inside a COM+ Server Application
on Windows Server 2000.  We programmed the COM+ component in .Net.  log4net
does not log anything and there is no exception (If there is any exception,
our component will write that to database).  The log4net configuration is
inside DLLHOST.exe.config under Windows/System32.  My questions is where I
should put the code of loading log4net configuration (see blow) in a .Net
Enterprise Service project.            

log4net.Config.DOMConfigurator.Configure()

Any suggestions?


Thanks for your help in advance!

Jack




RE: Configuration in COM+ Server Application

Posted by Craig Boland <cn...@sbcglobal.net>.
Have you considered a static constructor? They execute at most one time and
are thread-safe. If you have several classes in your component it may be
better to more the log4net construction into a separate class or method so
it can be synchronized. The Double-Checked Locking pattern may be useful
there.


-----Original Message-----
From: Jack Yang [mailto:jyang@logithink.com] 
Sent: Friday, July 22, 2005 5:31 PM
To: log4net-user@logging.apache.org
Subject: Configuration in COM+ Server Application

We are trying to use log4net (1.2.0-beta8) inside a COM+ Server Application
on Windows Server 2000.  We programmed the COM+ component in .Net.  log4net
does not log anything and there is no exception (If there is any exception,
our component will write that to database).  The log4net configuration is
inside DLLHOST.exe.config under Windows/System32.  My questions is where I
should put the code of loading log4net configuration (see blow) in a .Net
Enterprise Service project.            

log4net.Config.DOMConfigurator.Configure()

Any suggestions?


Thanks for your help in advance!

Jack