logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brendan M Wong <b...@ucdavis.edu>
Subject RE: outputting header twice for RollingFileAppender
Date Tue, 10 Nov 2009 22:31:25 GMT
Hi.  I have a RollingFileAppender where I've created a custom layout.  And, in the custom layout,
all I'm doing is adding a header row to my log file (see below).

public class NoMatchingTranscriptPatternLayout extends PatternLayout {

      public NoMatchingTranscriptPatternLayout() {

      public String getHeader() {
            return (new String("Date of Download\tPdf\n"));

Now, I have a job that's scheduled to run on a daily basis so the log files get updated daily.
 However, when the log file gets updated, the header gets outputted to the log file each time
the job is run.  I have log4j version 1.2.15.  Is this a bug?  Shouldn't the header only get
generated if the file is new?  Please advise.


Brendan Wong
Web Developer
Office of Graduate Studies

"Saving the world one pdf at a time"

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message