logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafferty Uy <rafferty...@easesolutions.com>
Subject My log4net is not working on releases (but works on asp.net debug mode)
Date Wed, 24 Dec 2008 06:41:57 GMT
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<mailto:rafferty.uy@easesolutions.com>


Mime
View raw message