Woohoo! That did the trick. Clearly there's something wrong with the way I use the XmlConfiguratorAttribute, although I haven't had any problems with .Net1.1. Maybe it's a .Net2.0 issue in log4net?
Thanks, Neil. -----Original Message----- From: Dag Christensen [mailto:[EMAIL PROTECTED] Sent: 13 May 2008 11:55 To: Log4NET User Subject: RE: Problem getting Log4net to work Appears that log4net is looking in the application's working folder? Haven't read the documentation in a while, but I can't remember seeing that the full path of a filename should be relative to the starting assembly's base folder? This problem will also surface if you run your application as a windows service, where your default working folder is likely to be %windir%\System32. Not a direct solution to your problem, but personally I prefer to configure log4net during application startup using the API: log4net.Config.XmlConfigurator.ConfigureAndWatch( new FileInfo( configFile ) ); where configFile is a full path based on or equal to the starting assembly's base path. Regards, Dag -----Original Message----- From: Neil Haughton [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 13, 2008 12:23 PM To: Log4NET User Subject: RE: Problem getting Log4net to work Thanks for responding. My mistake and I've corrected it, but it doesn't make a difference: <?xml version="1.0" encoding="utf-8" ?> <log4net> ... <appender name="RollingFileAppenderTRACE" type="log4net.Appender.RollingFileAppender"> <file value="c:\logs\MatrixTRACE.log" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%m%newline" /> </layout> <appendToFile value="true" /> <maximumFileSize value="100KB" /> <maxSizeRollBackups value="2" /> </appender> ... <logger name="Matrix.Trace"> <!--this is for routine debug logging to a file--> <level value="DEBUG" /> <appender-ref ref="RollingFileAppenderTRACE" /> </logger> ... </log4net> (This is the config file in the executable directory). Regards, Neil -----Original Message----- From: Dag Christensen [mailto:[EMAIL PROTECTED] Sent: 13 May 2008 10:46 To: Log4NET User Subject: RE: Problem getting Log4net to work The top level node should be log4net when you're using a stand-alone configuration file, not configuration. Configuration is afaik only used in app.config files. Regards, Dag -----Original Message----- From: Neil Haughton [mailto:[EMAIL PROTECTED] *snip* The bare bones of the log4net.config file is: <?xml version="1.0" encoding="utf-8" ?> <configuration> <log4net> <appender name="RollingFileAppenderROOT" type="log4net.Appender.RollingFileAppender"> <file value="c:\logs\MatrixROOT.log" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%m%newline" /> </layout> <appendToFile value="true" /> <maximumFileSize value="100KB" /> <maxSizeRollBackups value="2" /> </appender> <appender name="RollingFileAppenderTRACE" type="log4net.Appender.RollingFileAppender"> <file value="c:\logs\MatrixTRACE.log" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%m%newline" /> </layout> <appendToFile value="true" /> <maximumFileSize value="100KB" /> <maxSizeRollBackups value="2" /> </appender> <root> <appender-ref ref="RollingFileAppenderROOT" /> </root> <logger name="Matrix.Trace"> <!--this is for routine debug logging to a file--> <level value="DEBUG" /> <appender-ref ref="RollingFileAppenderTRACE" /> </logger> </log4net> </configuration> TIA Neil ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/ ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/