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:[EMAIL PROTECTED] 
> Sent: 15 June 2004 12:59
> To: [email protected]
> 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
> 

Reply via email to