logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: no log file is created
Date Wed, 27 Jun 2007 21:21:09 GMT
Have you enabled internal log4net debugging?

http://logging.apache.org/log4net/release/faq.html#internalDebug

----- Original Message ----
From: Samuel Rochas <samuel.rochas@iesedu.com>
To: log4net-user@logging.apache.org
Sent: Thursday, June 21, 2007 11:54:56 AM
Subject: no log file is created

Dear all,

I use to work with Log4j but I am new to Log4net. I try to setup a small 
example but no file is created while logging, though the line with the 
log instruction is executed. This is my setup, any hint? Thank you in 
advance.

*** web.config ***
<configuration>
  <!-- Register a section handler for the log4net section -->
  <configSections>
    <section name="log4net" 
type="System.Configuration.IgnoreSectionHandler" />
  </configSections>
  <appSettings>
    <!-- To enable internal log4net logging specify the following 
appSettings key -->
    <!-- <add key="log4net.Internal.Debug" value="true"/> -->
  </appSettings>
  <!-- This section contains the log4net configuration settings -->
  <log4net>
    <!-- Define some output appenders -->
    <appender name="A1" type="log4net.Appender.RollingFileAppender">
      <file value="log.txt" />
      <appendToFile value="true" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="1024KB" />
      <rollingStyle value="Size" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <!--
        <header value="[Header]&#13;&#10;" />
        <footer value="[Footer]&#13;&#10;" />-->
        <conversionPattern value="%date [%thread] %-5level %logger 
[%ndc] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="A1" />
    </root>
    <logger name ="L1">
      <level value="DEBUG" />
      <appender-ref ref="A1" />
    </logger>
  </log4net>
*********************

*** My code ***
    public static class Query
    {
        // Logger instance
        private static readonly ILog log = 
LogManager.GetLogger(typeof(Query));

        public static ArrayList myMethod(string id_p, string course_p)
        {
             log.Debug("Entering application.");


*****************





Mime
View raw message