Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-15423

SyslogHandler - wrong Timestamp format

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 9.0.1.Final
    • Logging
    • None
    • Hide

      Configure a SyslogHandler and send an event in October.

      Show
      Configure a SyslogHandler and send an event in October.

    Description

       

      The "org.jboss.logmanager.handlers.SyslogHandler" is adding a leading zero to the October month as it's concatenating '0' whenever the month value is below 10. However, the month number is zero based (January = 0). The outcome is an invalid ISO8601 timestamp as the month part will be '010' instead of '10'.

       

      Calendar cal = Calendar.getInstance();
      cal.setTimeInMillis(millis);
      int month = cal.get(2);
      int day = cal.get(5);
      int hours = cal.get(11);
      int minutes = cal.get(12);
      int seconds = cal.get(13);
      buffer.append(cal.get(1)).append('-');
      if (month < 10) {
      buffer.append(0);
      buffer.append(month + 1).append('-');

      Attachments

        Activity

          People

            jperkins-rhn James Perkins
            sfukayatcesp Sergio Minoru Fukaya
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: