Ryan, Have you tried running your app with log4net debug enabled? http://logging.apache.org/log4net/release/manual/faq.html#internalDebug
This should tell you when log4net tries to load the config file and what it found there. If this doesn't answer your questions then post the debug output here and we will see what we can diagnose. Nicko > -----Original Message----- > From: Beaver, Ryan [mailto:[EMAIL PROTECTED] > Sent: 23 July 2004 17:02 > To: '[email protected]' > Subject: Using log4net within a dll > > Hello All, > > I've searched over some post and found some examples > for using Log4NET in a dll. One post suggested that if I was > to encapsulate the log4NET coding in a dll, and call it from > an assembly, I should call the > DOMConfigurator.(PathToConfigurationFile) which I have. So > basically I call this, passing in a > FileInfo(AppDomain.CurrentDomain.SetupInformation.Configuratio > nFile) to Log4NET to let it know where my app.config file is. > I have created a simple appender in my config file to output > the data to a .txt file(posted below). > When I call DOMConfigurator, no Log4NETExample.txt is > created. When it moves further to actually trying to make a > call, I get this out of the console > window: > log4net:ERROR No appenders could be found for category > (Log4NetExample.frmMain) > log4net:ERROR Please initialize the log4net system properly. > > Any help would be greatly appreciated. > > Thanks, > Ryan > > <configSections> > <section name="log4net" > type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> > </configSections> > > <log4net debug="false"> > <appender name="LogFileAppender" > type="log4net.Appender.FileAppender,log4net" > > <param name="File" > value="C:\\Log4NetExample.txt" /> > <param name="AppendToFile" value="true" /> > <layout > type="log4net.Layout.PatternLayout,log4net"> > <param name="ConversionPattern" > value="%d [%t] %-5p %c [%x] - %m%n" /> > </layout> > </appender> > <root> > <priority value="DEBUG" /> > <appender-ref ref="LogFileAppender" /> > </root> > </log4net> > >
