Michael,

Sounds like a strange issue. Can you try changing your code to call
configure like this:

log4net.Config.DOMConfigurator.Configure(new
System.IO.FileInfo(System.AppDomain.CurrentDomain.SetupInformation.Confi
gurationFile));

Let me know if that makes a difference.

Nicko


> -----Original Message-----
> From: Michael [mailto:[EMAIL PROTECTED] 
> Sent: 13 July 2004 22:38
> To: 'Log4NET User'
> Subject: RE: Log4net new user: error no appender found: what 
> am I doing wrong?
> 
> Rich,
> Thanks for the info, but I'm still struggling. Here's my new 
> code: I'm just using the console appender:
> 
> app.config:
> 
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>       <configSections>
>               <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
>       </configSections>
> 
>       <log4net>
> <appender name="Console1" type="log4net.Appender.ConsoleAppender">
>       <layout type="log4net.Layout.PatternLayout">
>               <conversionPattern value="%date [%thread] 
> %-5level %logger [%ndc] - %message%newline" />
>       </layout>
> </appender>
>       <root>
>               <level value="DEBUG" />
>               <appender-ref ref="Console1" />
>       </root>
> </log4net>
>       
> <appSettings>
>       <add key="log4net.Internal.Debug" value="true"/> </appSettings>
>     
> </configuration>
> 
> 
> My console app:
> 
> namespace log4net_test
> {
>       /// <summary>
>       /// Summary description for Class1.
>       /// </summary>
>       class Class1
>       {
>               /// <summary>
>               /// The main entry point for the application.
>               /// </summary>
>               [STAThread]
>               static void Main(string[] args)
>               {
>                       log4net.Config.DOMConfigurator.Configure();
>                       log4net.ILog log =
> log4net.LogManager.GetLogger("MyLogger");
>                       log.Info("My info message");
>               }
>       }
> }
> 
> 
> When I execute the configure method, I get this:
> 
> log4net:ERROR No appender named [Console1] could be found.
> 
> Why can't it see it in the config file?
> 
> When I execute the log.Info method I get:
> 
> log4net:ERROR No appenders could be found for category (MyLogger).
> log4net:ERROR Please initialize the log4net system properly.
> 
> Help!!!
> Cheers
> Michael
>  
> 
> -----Original Message-----
> From: Denis, Rich [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2004 19:03
> To: Log4NET User
> Subject: RE: Log4net new user: error no appender found: what 
> am I doing wrong?
> 
> The logger name is not significant.  It only becomes 
> significant if you try to configure it with specific 
> appenders.  For what you are doing you should be fine.  I 
> personally find that the FileAppender is the easiest to use.
> Also you can use the console appender.  You can then see its 
> output using the VS debugger in the console view.  Hope this helps.  
> 
> Rich Denis
> perotsystems(tm)
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004
>  
> 
> 

Reply via email to