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

LoggingEvent.formattedMessage is only initialized in c'tor.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.12
    • Component/s: logback-classic
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      139

      Description

      LoggingEvent.formattedMessage is only initialized if message and arguments are supplied during construction. If the default c'tor is used and message and arguments are provided using setMessage and setArgumentArray then formattedMessage will stay null.

      Instead, formattedMessage should be declared transient and the actual formatting should take place lazily during getFormattedMessage call.

      This would fix this problem, would increase general logging performance (formatting only if actually needed) and would decrease the size of serialized log events significantly while it would not change anything from the callers point of view.

      This is a follow-up of LOGBACK-460

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ceki Ceki Gülcü
                Reporter:
                joern@huxhorn.de Joern Huxhorn
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: