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

"%prefix" composite converter

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 1.2.4, 1.3.0-alpha6
    • None
    • None
    • None

    Description

      In order to help output parsers, it is sometimes useful to prefix log output with the key of each item.

      Example 1:

      %X{user} 

      would be easier to parse if it were written as

      user=%X{user} 

      Example 2:

      %X{user} %{sessionId} %level %logger %msg

      would be easier to parse if written as

      user=%X{user} sessionId=%{sessionId} level=%level logger=%logger msg=%msg

      The prefix composite converter does the prefixing for you. Thus, the following two patterns generate equivalent output

      %prefix(%X{user} %{sessionId} %level %logger %msg)

      and

      user=%X{user} sessionId=%{sessionId} level=%level logger=$logger msg=%msg}

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            ceki Ceki Gülcü
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: