Thursday, March 11, 2010
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: My log4net is not working on releases (but works on asp.net debug mode)
Prev Next
You are not authorized to post a reply.

Author Messages
Rafferty Uy

12/24/2008 7:41 AM  

Hi,

I'm having problems getting logs to work. Here are some configuration snippets.

// -- IN MY LOG4NET.XML ------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<!-- This section contains the log4net configuration settings -->
<!-- See http://logging.apache.org/log4net/release/manual/introduction.html for more information -->
<log4net>
      <appender name="FileAppender" type="log4net.Appender.FileAppender">
            <file value="data/ErrorTrace.txt" />
            <appendToFile value="true" />
            <layout type="log4net.Layout.PatternLayout">
                  <conversionPattern value="%d %-5level %logger - %message%newline" />
            </layout>
      </appender>

      <!-- Possible levels: ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF -->
      <root>
            <level value="ALL" />
      </root>

      <logger name="MyWebAppLogger">
            <level value="ALL" />
            <appender-ref ref="FileAppender" />
      </logger>
</log4net>

// -- IN MY WEB.CONFIG -------------------------------------------
<add key="log4netXmlPath" value="log4net.xml"/>


// -- IN MY GLOBAL.ASAX.CS ---------------------------------------
protected void Application_Start(object sender, EventArgs e)
{
      var config = new FileInfo(configPath);
      log4net.Config.XmlConfigurator.ConfigureAndWatch(config);
}


What could be wrong? For some reason when I enter debug mode through visual studio (by pressing F5), it correctly creates the data sub directory as well as the ErrorTrace.txt. However, it does not work when I copy the release files to my IIS virtual directory.
*Additional note: the virtual directory is configured to have write access.

Can anyone help?


Rafferty

 

Best regards / mit freundlichen Grüßen,

 

Rafferty Uy

Software Engineer

 

ease solutions Pte. Ltd.

30B Temple Street

Singapore 058575

 

Tel: +65 6220 7488

Fax: +65 6223 0815

 

Web: www.easesolutions.com

Email: rafferty.uy@easesolutions.com

 

Steve Wagner

12/24/2008 9:29 AM  

Sounds like a rights problem. Check if the IIS User can create directory
and files.

Marry christmas

Steve

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > My log4net is not working on releases (but works on asp.net debug mode)



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement