This issue has been reported before.  If you come up with a fix, please
submit it for review and inclusion in a future version of log4j.  You might
even want to write a bug.

thanks,
-Mark

> -----Original Message-----
> From: Klein, Scott @ TW [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 31, 2003 8:21 AM
> To: 'David Sanders'; Log4J-User (E-mail)
> Subject: RE: Help with Log4j automatic header generataion
> 
> 
> I guess it depends on what the user really wants, but it 
> seems that there
> should be some checking (or an option) to alter the behavior 
> of writing a
> header to anything but a "fresh" file. I could see where you 
> might want a
> continous log regardless of shutdown, and also where you may 
> want a header
> to signal the restart of the log....
> 
> -----Original Message-----
> From: David Sanders [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 6:02 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: Help with Log4j automatic header generataion
> 
> 
> http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg0
5953.html


Thank you for the solution.  One problem, though:  If the logging 
process (JVM) is stopped and restarted, a 2nd header is written to the 
existing file.

Example:
- using DailyRollingFileAppender
- logged record #1.  Header was written first by MyPatternLayout.
- logged record #2
- Stopped process
- Started process
- logged record #3.  Header and record #3 were appended to existing file.

I don't want the header written if it's not a new file.  I'll see if 
PatternLayout can call theFile.length() and only write if length is 0.


David



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to