Ismail,

If you enable log4net internal debugging you should see log4net
initialising, and if there are any errors then they will also be
displayed there.
http://logging.apache.org/log4net/release/manual/faq.html#internalDebug

Nicko 

> -----Original Message-----
> From: Ismail Mayat [mailto:[EMAIL PROTECTED] 
> Sent: 12 August 2004 12:30
> To: '[email protected]'
> Subject: log4net with asp.net
> 
> Support,
> 
> Version : log4net-1.2.0-beta8
> Project type : ASP.NET project
> When i attempt to do logging in asp.net project a log is not 
> created, I have
> the following code in a c# class that is called by asp.net page
> private static readonly ILog Logger =
> LogManager.GetLogger(typeof(ContentExporterController));
>               /// <summary>
>               /// The default constructor method.
>               /// </summary>
>               public ContentExporterController()
>               {
>                       //init the logger
>                       
>                       DOMConfigurator.Configure(new
> System.IO.FileInfo(System.Environment.CurrentDirectory  + 
> "\\" + "xml" +
> "\\" + "log4j_exporter.xml")); //this gives me D:\temp
>                       
>                       Logger.Debug("Successfully initialised");
>               }
> When I step through code and i get to DOMConfigurator line the actual
> directory returned is D:\temp\xml\log4j_exporter.xml, the xml 
> file contains
> the following
> <?xml version="1.0" encoding="UTF-8" ?> 
> - <log4net> 
> - <appender name="RollingFile" 
> type="log4net.Appender.RollingFileAppender"> 
> <file value="log/ContentExporter.log" /> 
> <appendToFile value="false" /> 
> <maximumFileSize value="1000KB" /> 
> <maxSizeRollBackups value="2" /> 
> - <layout type="log4net.Layout.PatternLayout"> 
> <conversionPattern value="%p >> %t %c - %m%n" /> 
> </layout> 
> </appender> 
> - <root> 
> - <!-- 
>  
>                       the levels are 
>                       ALL 
>                       DEBUG 
>                       INFO 
>                       WARN 
>                       ERROR 
>                       FATAL 
>                       OFF 
>               if you set to info then all statements below 
> and including
> info are logged
>               
> --> 
> <level value="DEBUG" /> 
> 
> 
> <appender-ref ref="RollingFile" /> 
> </root> 
> </log4net>
> The xml dir and log dir are present in the d:\temp dir and 
> have been opened
> to the aspnet account and given read/write access.  I get no 
> errors and no
> log file.
> 
> Thanks 
> Regards
> Ismail
> 

Reply via email to