Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1109

Logback-core release 1.1.3 missing fix for setting the timezone in the TimeBasedFileNamingAndTriggeringPolicyBase

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.3
    • logback-core
    • Linux/Windows

    Description

      1.1.3 introduced the idea that we could specify a TZ in the

      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <FileNamePattern>${LOG_DIR}/myapp.%d

      {yyyy-MM-dd,UTC}

      .log</FileNamePattern>
      </rollingPolicy>

      This doesn't work for me and it looks like a bug was found with this and fixed on master by "s4nk" on 18th Mar
      https://github.com/qos-ch/logback/commits/master/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedFileNamingAndTriggeringPolicyBase.java

      The source for the 1.1.3 build (created 24th March 2015) does not appear to contain this fix

      (from Maven Central 1.1.3 source jar)
      Ie it has
      public void start() {
      ....
      rc = new RollingCalendar();

      rather than what was committed in the fix which checks the TZ before creating the calendar:
      (from https://github.com/qos-ch/logback/commit/077e45c8f71045d75519e9c059ecbd1faee5cd09)

      if (dtc.getTimeZone() != null) {
      rc = new RollingCalendar(dtc.getTimeZone(), Locale.getDefault());
      } else {
      rc = new RollingCalendar();
      }

      Given the release build was created on 24th March I think something was a bit screwy in how the build was created as the above fix should have been picked up in 1.1.3 if it was done against master.

      Would it be possible for you to make a new official 1.1.4 release that really contains the fix ? I know I can create a local one but I'd rather not fork the project unless I really have to.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            jfoxon john foxon
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: