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

log4j doesn't find log4j2.yaml

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.8.2
    • 2.9.0
    • Configurators
    • None

    Description

      A repository demonstrating the issue: https://github.com/flaghacker/Log4jTest

      I added a file called log4j2.yaml in the resources folder, so it should be on the classpath. Building an actual jar does confirm this.

      When running this project (gradlew run) I get the following warning:
      ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.

      If I enable TRACE logging, one of the lines shows lo4j2 did indeed try looking for the file:

      TRACE StatusLogger Trying to find [log4j2.yaml] using context class loader sun.misc.Launcher$AppClassLoader@18b4aac2.

      Did I make a mistake somewhere? Or is this an actual bug?

      Attachments

        Issue Links

          Activity

            People

              mikaelstaldal Mikael Ståldal
              ToddSewell Todd Sewell
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: