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

Add support for Log4J %l (Location)

    XMLWordPrintable

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.1.3
    • logback-classic

    Description

      In PatternLayout, log4J (both 1.2 and 2.0) supports the %l encoding, which reads:

      Used to output location information of the caller which generated the logging event.

      The location information depends on the JVM implementation but usually consists of the fully qualified name of the calling method followed by the callers source the file name and line number between parentheses.

      The location information can be very useful. However, its generation is extremely slow and should be avoided unless execution speed is not an issue.

      However, this is not supported in Logback. I know that similar behavior can be achieved with {{%caller

      {1}

      }}, but the formatting for that is quite rigid and also can be quite ugly. Can we have support for %l?

      Attachments

        Activity

          People

            logback-dev Logback dev list
            durron597 Jared Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: