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

Please add a sequence number to LoggingEvent

    XMLWordPrintable

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.16
    • logback-classic
    • None

    Description

      It would be very nice to have an optional Long sequenceNumber in LoggingEvent, similar to what java.util.logging is providing.

      This would be useful in case of e.g. a SocketAppender where some events are lost between two connections. Another use-case would be a central logging server receiving the events. In that case, the sequence number - in combination with logger context info - could be used to uniquely reference events.

      The way I'd see this implemented is in the respective appenders, not in the LoggerContext itself, because otherwise one would have gaps in case of filtered-out events. An implementation would set the sequence number of the LoggingEvent, serialize it by whatever means and reset the sequence number to null afterwards so it doesn't leak to other appenders.

      Comments?

      Attachments

        Activity

          People

            logback-dev Logback dev list
            jhuxhorn Joern Huxhorn
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: