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

Make logback in SL4J show relative time (%r) in hours, minutes and seconds

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.2.1
    • None

    Description

      I know that %r in logback outputs the relative time from the start of the logging event in milliseconds, but it seems that there's not way to set it in a pattern like HH.mm.ss.SSS.

      Unfortunately, something along the lines of %r{HH.mm.ss.SSS} (which is the way I do it for the current date/time %d) doesn't work. I can of course build a StopWatch object and manually output its value every time I call the logger, but this way seems rather unpractical.

      Such a feature would be quite useful I think, and I was also suggested to post a feature request here after asking a similar question on stackoverflow.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            st1led Stefano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: