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

List:       log4net-user
Subject:    RE: config is not read with COM Addin
From:       "Nicko Cadell" <nicko () neoworks ! com>
Date:       2004-06-27 18:37:35
Message-ID: DDEB64C8619AC64DBC074208B046611C0B5D51 () kronos ! neoworks ! co ! uk
[Download RAW message or body]

Marco,

The config file is loaded from the application directory not from the
directory containing the dll. The AppDomain.CurrentDomain.BaseDirectory
property is used to lookup the application directory. This allows a dll
to reside in the GAC an have different configuration for different
applications. You can either work out where the application base
directory is for Outlook and move your config file there or you can load
the configuration file programmatically using the
DOMConfiguratior.Configure(FileInfo) method.

Nicko

> -----Original Message-----
> From: Marco Dissel [mailto:mdissel@home.nl] 
> Sent: 15 June 2004 12:59
> To: log4net-user@logging.apache.org
> Subject: config is not read with COM Addin
> 
> Hello
> 
> I created an Outlook addin and want to use log4net for 
> logging. If i debug my addin within VS.NET the log4net 
> assembly is loaded. Log.Debug("blalaaa") is not resulting in 
> a logentry. and no log4net debug info is logged (debug=true 
> in the config file) to the debug window in vs.net. 
> 
> I added these lines to the assembly.cs:
> [assembly: log4net.Config.Domain("Addin")]
> [assembly: 
> log4net.Config.DOMConfigurator(ConfigFileExtension="log4net", 
> Watch=true)]
> 
> My logfile is named Addin.dll.log4net and contains these settings:
> <?xml version="1.0" encoding="utf-8" ?>
> <log4net debug="true">
> 	<appender name="Default" 
> type="log4net.Appender.RollingFileAppender">
> 		<param name="File" value="log.txt" />
> 		<param name="AppendToFile" value="true" />
> 		<param name="RollingStyle" value="Size" />
> 		<param name="MaxSizeRollBackups" value="10" />
> 		<param name="MaximumFileSize" value="500KB" />
> 		<param name="StaticLogFileName" value="true" />
> 		<layout type="log4net.Layout.PatternLayout">
> 			<param name="ConversionPattern" 
> value="%d [%t] %-5p %c [%x] - %m%n" />
> 		</layout>
> 	</appender>
> 
> 	<root>
> 		<level value="DEBUG" />
> 		<appender-ref ref="Default" />
> 	</root>
> </log4net>
> 
> 
> What's wrong?
> 
> Thanks
> 
> Marco
> 

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

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