Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39079

Record timestamps for pipeline jobs without filling the log file with console notes

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Minor Minor
    • timestamper-plugin
    • None
    • Jenkins 2.7.4
      Timestamp plugin 1.8.7

      Although the source documentation indicates otherwise, it appears that the encoded timestamps are always being inserted directly into the console log files leading to difficulty parsing files from disk.

      /**
       * Time-stamp console note.
       * <p>
       * These are inserted into the log file when:
       * <ul>
       * <li>The build does not extend {@link AbstractBuild}, e.g. a pipeline job.</li>
       * <li>Running the Timestamper plugin prior to version 1.4.</li>
       * <li>The system property is set: ({@link #getSystemProperty()}). The is
       * intended to support scripts that were written prior to Timestamper 1.4 to
       * parse the log files. New scripts should query the {@code /timestamps} URL
       * instead (see {@link TimestampsAction}).</li>
       * </ul>
       * <p>
       * Otherwise, the time-stamps are stored in a separate file, which allows a more
       * compact format to be used and avoids filling the log files with encoded
       * console notes.
       * 
       * @author Steven G. Brown
       */
      

      Seem to indicate that a pipeline job using recent versions of the plugin should not have this issue. But the system property is checked as a boolean and since TimeStampNote.getSystemProperty() always returns a string its always true.

          [JENKINS-39079] Record timestamps for pipeline jobs without filling the log file with console notes

          Steven G Brown added a comment - - edited

          Pipeline jobs do not extend AbstractBuild and so they rely on console notes to work. I've tried to clarify the documentation here: 70f165c.

          I'd love to have the pipeline builds working without filling the log file with console notes, but no-one has implemented that yet.

          But the system property is checked as a boolean and since TimeStampNote.getSystemProperty() always returns a string its always true.

          No, it looks up the system property with that name. Have a look at the Javadoc for Boolean.getBoolean(String).

          Steven G Brown added a comment - - edited Pipeline jobs do not extend AbstractBuild and so they rely on console notes to work. I've tried to clarify the documentation here: 70f165c . I'd love to have the pipeline builds working without filling the log file with console notes, but no-one has implemented that yet. But the system property is checked as a boolean and since TimeStampNote.getSystemProperty() always returns a string its always true. No, it looks up the system property with that name. Have a look at the Javadoc for Boolean.getBoolean(String) .

          Would also fix JENKINS-45683

          Steven G Brown added a comment - Would also fix JENKINS-45683

          trejkaz added a comment -

          Wondering whether the size of the entries it's writing into the log could at least be reduced. For us, it's adding about 320 bytes per log line, and makes the logs so much bigger that builds are occasionally failing because the master can't cope with all the additional log data.

          trejkaz added a comment - Wondering whether the size of the entries it's writing into the log could at least be reduced. For us, it's adding about 320 bytes per log line, and makes the logs so much bigger that builds are occasionally failing because the master can't cope with all the additional log data.

          Basil Crow added a comment -

          jglick, do you think this can be closed as a duplicate of JENKINS-48344?

          Basil Crow added a comment - jglick , do you think this can be closed as a duplicate of JENKINS-48344 ?

          Jesse Glick added a comment -

          Yes, sounds that way.

          Jesse Glick added a comment - Yes, sounds that way.

            Unassigned Unassigned
            jwelch92 jared welch
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: