Hey Nicko, Thanks for the reply! I feel a bit stupid about this. I get these errors with the error checking on:
log4net:ERROR No appender named [LogFileAppender] could be found. log4net:ERROR No appenders could be found for category (Log4NetExample.frmMain). log4net:ERROR Please initialize the log4net system properly. Does an xml appender definition file need to go into my bin directory or something similiar to that? I was just curious because my appenders seem to be quite common in the examples. Thanks, Ryan -----Original Message----- From: Nicko Cadell [mailto:[EMAIL PROTECTED] Sent: Friday, July 30, 2004 4:03 PM To: Log4NET User Subject: RE: Using log4net within a dll 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> > >
