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

Why the logger get by Slf4j LoggerFactory.getILoggerFactory() can only use current LoggerContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.13.3, 2.14.1
    • 2.15.0
    • SLF4J Bridge
    • Spring Boot 2.4.5

      Slf4j

    Description

      In SpringBoot project with test profile,

      org.slf4j.LoggerFactory.getLogger("xxx") can get test profile LoggerContext and read configuration from log4j2-test.xml.

      But

      org.slf4j.LoggerFactory.getILoggerFactory().getLogger("xxx") can only get current LoggerContext and read configuration from log4j2.xml.

       

      Is it designed like this? Why?

      Attachments

        Activity

          People

            ckozak Carter Kozak
            hao5ang wanghao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: