logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baron Schwartz <ba...@sequent.org>
Subject Re: Log files misnamed
Date Tue, 05 Jul 2005 17:56:08 GMT
Hi Nicko,

> Does this issue arise each time you restart your service or just
> sometimes when you restart?

Only sometimes.

> Does this issue occur if you write to a local disk rather than a share?

I have not noticed it.  I have not configured the service to do that.

> What OS and file system is the logs share using?

Windows 2000 Server, NTFS.

> Does the appender write the current logs into the incorrectly named
> file? or does it also create the correctly named file?

It seems to happen when the correctly named file already exists, and in 
every case that I see, there is output in that file.  The app is 
multi-threaded, and there is a timer event that wakes up the 
job-dispatching thread, which checks the database and starts off a 
thread to do whatever is scheduled in the database.  The job-dispatcher 
thread then dies.

I see two cases of this in the log directory right now.  The first case 
has output into the correctly named file up to a certain time.  Then the 
output goes into the second file for a few minutes, for the duration of 
a certain scheduled chunk of work.  Then it goes back into the correct 
file.  The log output doesn't reveal whether I restarted the service 
twice to cause this situation.

In the second case I can see log statements indicating that I restarted 
the service.  When I started it again, the incorrectly named file 
received all further output until midnight, when a new file was created.

If it's helpful, I can try stopping and restarting the service 
repeatedly during a time when there will be nothing scheduled in the 
database, and the only output would be "I got started!" so it wouldn't 
negatively impact our systems.  Maybe if I do this enough I can 
reproduce the behavior.  If so, I guess I should enable internal debugging?


>>-----Original Message-----
>>From: Baron Schwartz [mailto:baron@sequent.org] 
>>Sent: 27 June 2005 20:01
>>To: log4net-user@logging.apache.org
>>Subject: Log files misnamed
>>I have a RollingFileAppender configured as follows:
>>     <log4net>
>>         <appender name="FileAppender" 
>>             <file value="//tank/logs$/seo/log-" />
>>             <appendToFile value="true" />
>>             <datePattern value="yyyy-MM-dd'.txt'" />
>>             <rollingStyle value="Date" />
>>             <staticLogFileName value="false" />
>>             <layout type="log4net.Layout.PatternLayout">
>>                 <conversionPattern value="%-5p %d %c line 
>>%L%n %m%n" />
>>             </layout>
>>         </appender>
>>         <appender name="SmtpAppender" 
>>             <to value="[edit]" />
>>             <from value="[edit]" />
>>             <subject value="SEO error" />
>>             <smtpHost value="madrid" />
>>             <bufferSize value="2" />
>>             <lossy value="true" />
>>             <evaluator type="log4net.Core.LevelEvaluator">
>>                 <threshold value="WARN"/>
>>             </evaluator>
>>             <layout type="log4net.Layout.PatternLayout">
>>                 <conversionPattern value="%-5p %d %c line 
>>%L%n %m%n" />
>>             </layout>
>>         </appender>
>>         <root>
>>             <level value="ERROR" />
>>             <appender-ref ref="FileAppender" />
>>             <appender-ref ref="SmtpAppender" />
>>         </root>
>>         <logger name="SeoLibrary">
>>             <level value="INFO" />
>>         </logger>
>>     </log4net>
>>It should (and usually does) produce files named thusly:
>>But every now and again, when I restart the service that's 
>>doing the logging, it makes a new file named incorrectly:
>>What do you think?  It's not a real problem for me, but maybe 
>>it is a bug.

View raw message