Hi, 

I'm a newbie to Log4Net and I just got 
ASPNetTraceAppender to work, however, as soon as I
switch to my FileAppender, nothing happens. log file
is empty. 

I'm using 1.2 beta8 and here is what I did under
"myapp" application. 

/myapp
  /config
  /log

1. I have a /config directory holding the log4net
configuration file[Logging.log4net]. I have a /log
directory which will hold my log files. 

2. in my assembly.cs I did

[assembly:
log4net.Config.DOMConfigurator(ConfigFile="config/Logging.log4net",ConfigFileExtension="log4net",Watch=true)]

*Note, at this point, I know the right configuration
was found because ASPNetTraceAppender worked. 

3. This is my configuration file

<!-- FileAppender appends to a log and it is manually
managed or size -->
    <appender name="FileAppender"
type="log4net.Appender.FileAppender" >
      <param name="File"
value="D:\Liming\Websites\Myapp\log\LetterUrgent.log"
/>      
      <param name="AppendToFile" value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t]
%-5p %c [%x] - %m%n" />
      </layout>
    </appender>

   ...
   ...
   ...

    <root>
      <level value="WARN" />
      <appender-ref ref="ADONetAppender_Access" />
    </root>
    
    <logger name="PreliminaryLetterWeb">
      <level value="info" />
      <appender-ref ref="FileAppender" />
    </logger>

4. I have a PreliminaryLetterWeb class in which I did

private static readonly ILog log =
LogManager.GetLogger("PreliminaryLetterWeb");
 
....
....
        log.Info("Info");
                        log.Debug("Debug");
                        log.Warn("Warn me");
                        log.Error("Error");
                        log.Fatal("Fatal");


So that's the whole situation and I did set the /log
directory to have the right permission [since I got
frustrated, I gave everyone full control]

Any insight into this problem of mine is greatly
appreicated. Thanks again

Lim


                
__________________________________ 
Do you Yahoo!? 
Send a seasonal email greeting and help others. Do good. 
http://celebrity.mail.yahoo.com

Reply via email to