logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Where do I place my Log4net.config file in an IIS-based Remoting Application?
Date Thu, 14 Jul 2005 20:51:02 GMT
The link to my code was meant to show that the Configure method has an
overload that accepts a FileInfo object. In the constructor of your
main class, are you able to do something like this:

 FileInfo log4netConfig = GetLog4netConfigFile();

 log4net.Config.XmlConfigurator.ConfigureAndWatch(log4netConfig);

I'm not familiar with remoting apps so this may not be possible.

--- Johan Glozman <johanglozman@yahoo.com> wrote:

> Because this is a remoting app, the way I've done it is to call
> Configure() in the constructor of the main class.  This works when
> the config information is in web.config.
>  
> -Johan
> 
> Ron Grabowski <rongrabowski@yahoo.com> wrote:
> Are you able to call Configure yourself during Application_Start?
> 
> http://tinyurl.com/87b8q
>
http://www.mail-archive.com/log4net-user%40logging.apache.org/msg01960.html
> 
> --- Johan Glozman wrote:
> 
> > I have a .NET Remoting application for which I am using log4net. I
> > have a number of clients and a server that is hosted in IIS. IIS
> has
> > a Virtual Directory called RemotingServerEngine with a file
> > "RemotingEngine.rem" in it.
> > 
> > Currently, the server has a web.config file with a log4net section
> in
> > it, and this works great.
> > 
> > I would like to remove the log4net configuration section from
> > web.config (it could get really large) and put it in a separate
> file.
> > 
> > The steps I have followed are:
> > * remove the log4net section from web.config
> > * create a file "log4net.config" in the same place as web.config
> and
> > put all the logging information in there.
> > * add a line to AssemblyInfo.cs: [assembly:
> > log4net.Config.DOMConfigurator(
> > ConfigFile="Log4Net.config",Watch=true )]
> > 
> > When I try to do this, everything compiles, but it doesn't log. I
> > have tried moving the log4net.config file all over the place: in
> the
> > directories with dlls, into C:\, anyplace I could think of. No
> dice.
> > It can't seem to find the file no matter where I put it.
> > 
> > What am I doing wrong?
> > 
> > The log4net version I am using is 1.2.0.30714.
> > 
> > Thanks,
> > -Johan
> > 
> > 
> 
> 


Mime
View raw message