Hadoop Common
  1. Hadoop Common
  2. HADOOP-5100

Chukwa Log4JMetricsContext class should append new log to current log file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Log4JMetricsContext is setting is own appender dynamically and by doing so it's truncating the current log file. It should append to it if the file exist.

      1. HADOOP-5100.patch
        1 kB
        Jerome Boulon
      2. HADOOP-5100.patch
        1 kB
        Jerome Boulon

        Issue Links

          Activity

          Hide
          Jerome Boulon added a comment -

          Set append flag to true.

          From log4j Doc API
          /**
          The <b>Append</b> option takes a boolean value. It is set to
          <code>true</code> by default. If true, then <code>File</code>
          will be opened in append mode by

          {@link #setFile setFile} (see
          above). Otherwise, {@link #setFile setFile}

          will open
          <code>File</code> in truncate mode.

          <p>Note: Actual opening of the file is made when

          {@link #activateOptions}

          is called, not when the options are set.
          */
          public
          void setAppend(boolean flag)

          { fileAppend = flag; }
          Show
          Jerome Boulon added a comment - Set append flag to true. From log4j Doc API /** The <b>Append</b> option takes a boolean value. It is set to <code>true</code> by default. If true, then <code>File</code> will be opened in append mode by {@link #setFile setFile} (see above). Otherwise, {@link #setFile setFile} will open <code>File</code> in truncate mode. <p>Note: Actual opening of the file is made when {@link #activateOptions} is called, not when the options are set. */ public void setAppend(boolean flag) { fileAppend = flag; }
          Hide
          Jerome Boulon added a comment -

          Junit failed because of HADOOP-5138

          Show
          Jerome Boulon added a comment - Junit failed because of HADOOP-5138
          Hide
          Jerome Boulon added a comment -

          upload the patch again so that it could be picked up by Hudson

          Show
          Jerome Boulon added a comment - upload the patch again so that it could be picked up by Hudson
          Hide
          Ari Rabkin added a comment -

          Looks good. +1

          Show
          Ari Rabkin added a comment - Looks good. +1
          Hide
          Chris Douglas added a comment -

          I committed this. Thanks, Jerome

          Show
          Chris Douglas added a comment - I committed this. Thanks, Jerome
          Hide
          Hudson added a comment -
          Show
          Hudson added a comment - Integrated in Hadoop-trunk #756 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/756/ )

            People

            • Assignee:
              Jerome Boulon
              Reporter:
              Jerome Boulon
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development