ASP.NET is not a console application, hence no console output.  If you want to see the log information in Visual Studio's output window, you need to configure a trace appender. You can do this in code, or you use the XmlConfigurator to load in the configuration information.
 

<?xml version="1.0" encoding="utf-8"?>
<log4net threshold="INFO">

 <!-- to see in output window  use the trace appender -->
 <appender name="ASPNETDebugger" type="log4net.Appender.TraceAppender">
  <layout type="log4net.Layout.SimpleLayout" />
 </appender>
 <root>
  <level value="ALL" />
  <appender-ref ref="ASPNETDebugger" />
  <!-- Other Appenders here -->
 </root>
</log4net>



From: Gary Hinger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 28, 2006 9:10 PM
To: Log4NET User
Subject: RE: log4net logging not working

I think I solved my own problem.

 

Aapparently, it’s necessary to give IWAM_machinename write permissions to the log files. This solved the problem of writing to files. BTW, I’m using an IIS 5.1 server.

 

I’m still curious as to why there is no console output after BasicConfigurator.Configure().

 


From: Gary Hinger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 28, 2006 5:44 PM
To: [email protected]
Subject: log4net logging not working

 

Every kind of log4net logging I’ve tried fails to work.

 

For example, even attempting basic logging in a C# web app results in no console output:

 

                  BasicConfigurator.Configure();

                  log.Fatal( "Hello world!" );

 

Any ideas?

 

Reply via email to