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 20:59:13 GMT
I'd recommend starting with an appender that does not write any files to verify that log4net
is starting correctly. ConsoleAppender and/or the AspNetTraceAppender are good canidates.

----- 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 

*** web.config ***
  <!-- Register a section handler for the log4net section -->
    <section name="log4net" 
type="System.Configuration.IgnoreSectionHandler" />
    <!-- To enable internal log4net logging specify the following 
appSettings key -->
    <!-- <add key="log4net.Internal.Debug" value="true"/> -->
  <!-- This section contains the log4net configuration settings -->
    <!-- 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" />
      <level value="DEBUG" />
      <appender-ref ref="A1" />
    <logger name ="L1">
      <level value="DEBUG" />
      <appender-ref ref="A1" />

*** My code ***
    public static class Query
        // Logger instance
        private static readonly ILog log = 

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


View raw message