New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using log4j2 log4j2-test.* files are not detected #17001
Comments
log4j2-test.xml files should be picked up as expected. Here's the output from launching a
As you can see from the error caused by it being empty, the file has been picked up. If you would like us to spend some more time investigating, please take the time to provide a minimal sample that reproduces the problem either as a separate GitHub repository or as a zip attached to this issue. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
@wilkinsona I am not the original author if the issue, but still - a demo showing the problem: |
Thanks very much, @dewa-actico. That's given me what I needed to pinpoint the problem. Lines 105 to 121 in ed9cace
By contrast, Lines 97 to 100 in ed9cace
The result of this is the |
When using log4j2 via the
spring-boot-starter-log4j2
, I'd expect thelog4j2-test.xml
file (actually, all*-test.*
, as seen here: https://logging.apache.org/log4j/2.x/manual/configuration.html#Automatic_Configuration) to be picked up and used by Spring for unit tests.We want to use log4j2, and have separate logging config files for tests and in the final artifact.
The log4j2 project specifies an exact order in which log config files should be picked up: https://logging.apache.org/log4j/2.x/manual/configuration.html#Automatic_Configuration
The text was updated successfully, but these errors were encountered: