Grails 3.3.3: logging:config: ignores log4j2 config file
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
### Task List
- [x] Steps to reproduce provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
### Steps to Reproduce
1. Create a new Grails 3.3.3 project
2. Add sample Log4j2.xml file to src/main/resources
3. Rename it to log4j22.xml
4. Exclude logback from spring-boot-starter-actuator in build.gradle
5. Add spring-boot-starter-log4j2, log4j-api:2.8, log4j-core:2.8 to build.gradle
6. Add
logging:
config: classpath:log4j22.xml
to application.yml
7. Create a sample controller and log something.
### Expected Behaviour
Logs should be produced using provided log4j configuration
### Actual Behaviour
Default log4j configuration is used
After renaming log4j22.xml to log4j2.xml and removing logging: config: log4j picks up configuration file properly.
### Environment Information
- **Operating System**: Windows 10
- **Grails Version:** 3.3.3
- **JDK Version:** 1.8.161
- **Container Version (If Applicable):** Tomcat
### Example Application
https://github.com/tarasrng/logging3
Contributor guide
Research direction
Start by running the example application linked in the issue and follow its build.gradle, application.yml, and src/main/resources/log4j22.xml setup. Compare the logging behavior with the listed reproduction steps; done means the configured Log4j file is used instead of the default configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, spring-boot
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100