Saturday, February 04, 2012
 
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: Rollingfileappender doesn't roll over
Prev Next
You are not authorized to post a reply.

Author Messages
Radovan Raszka

07/30/2009 4:14 PM  

Hello to all,
I have interesting problem with RollingFileAppender in ASP.Net webservice. When webservice run on IIS on Windows XP, all works well, log file is rolled over days.

But when it was deployed to IIS running on the Windows 2003 Server, logging still work, but…. Log file is not rolled over, messages are still written into single file !

Has anybody similar experience or (better) knowledge what goes wrong?
I am not sure if there can be problem with rights, but initially webservice was able to create log file. What permissions are needed for logging from ASP.Net applications? And for which accounts? There are differences between Win XP, Win 2003 server and Win 2003 domain controller. My server is win2003 standalone server, not in any domain.

Here is my code:

public class SyncServ : System.Web.Services.WebService
{
        private static log4net.ILog log;

        public SyncServ()
        {
                log4net.Config.XmlConfigurator.Configure();
                log = log4net.LogManager.GetLogger(this.GetType());
        }
        [WebMethod]
        public bool SomeMethod()
        {
                log.Debug("some message");
                // do some work
                return true;
        }
               
}

Here's my web config:
<?xml version="1.0" encoding="UTF-8"?>

<configuration>
        <configSections>
                <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
                <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

        </configSections>
        <appSettings>
                <add key="Server" value="." />
                <add key="SysPath" value="F:\data\Ivs\" />
                <add key="PullBatchSize" value="200" />
        </appSettings>
    <connectionStrings />
 
    <system.web>
        <compilation debug="true" />
        <authentication mode="Windows" />
    </system.web>
    <system.webServer>
        <defaultDocument>
            <files>
                <add value="SyncServ.asmx" />
            </files>
        </defaultDocument>
    </system.webServer>
        <log4net>
                <!-- Define some output appenders -->
                <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
                        <file value="Log/Web.log" />
                        <appendToFile value="true" />
                        <layout type="log4net.Layout.PatternLayout">
                                <conversionPattern value="%date %-5level %message%newline" />
                        </layout>
                        <rollingStyle value="Date" />
                        <Threshold value="DEBUG" />
                </appender>
                <root>
                        <level value="ALL" />
                        <appender-ref ref="LogFileAppender" />
                </root>
        </log4net>
</configuration>

With regards Radovan Raszka
Software development dept.
HaSaM, s.r.o.
Tecovice 45, 763 02  Zlín-4
tel: (+420) 577 101 261
fax: (+420) 577 101 280
www.hasam.cz


Pascal ROZE

07/30/2009 4:20 PM  
Hi

There is no datePattern in your appender definition.
Maybe this is the problem.

Pascal
Radovan Raszka

07/31/2009 7:54 AM  
Hello,
thanks for proposal, but I don't think it is problem as it works well on windows XP. Problem is only on windows 2003.
But I try this parameter, miracle can happen :-}
RR 
You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > Rollingfileappender doesn't roll over



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