Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-50

Incorrect %C output (FQCN)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Core
    • None

    Description

      The fully qualified class name must be set correctly to support conversions like %C. In some cases, %C information is incorrect. I think this is related to AbstractLogger allowing getFQCN() to be overridden. Log methods handled by AbstractLogger should have AbstractLogger's FQCN, not that of the subclass.

      Example:

      slf4jLogger.info("slf4jLogger test %C."); // works; SLF4JLogger overrides this method
      slf4jLogger.info("slf4jLogger test %C.", t); // fails with '?'; handled by AbstractLogger
      category2.info("category test %C"); // fails with 'o.a.l.Category'

      Output:

      INFO Log4j2Testing [main] slf4jLogger test %C.
      INFO ? [main] slf4jLogger test %C.
      java.lang.Throwable
      at Log4j2Testing.main(Log4j2Testing.java:22)
      INFO o.a.l.Category [main] category test %C

      Attachments

        1. 0004-cleanup-FQCN-code.patch
          39 kB
          John Vasileff

        Activity

          People

            rgoers Ralph Goers
            jvasileff John Vasileff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: