I am not able to get log4j to work in a project with Grails 3.2.3. My aim is to get detailed logs of the spring security plugin, because I have some problems with it and want to know whats going on (I cannot login although I provide correct credentials).
I added the following lines to grails-app/conf/application.groovy
:
log4j = {
all 'org.springframework'
'org.grails.plugins:spring-security-core'
debug 'grails.app'
appenders {
file name: 'file', file:'logs/logging.log'
}
root {
all 'stdout', 'file'
}
}
But when I run the application with grails run-app
or run-app
in the interactive mode, no file is created, and there is no output in the console, even if I try to log in and the login fails (which should of course create some log messages, especially because of the log level "all").
I am no expert with log4j
. I never used it before.
I read through some tutorials and documentation, but they are all related to plain java programmes, not Grails.
Most of my Grails configuration is in YAML (application.yml
), only the spring and log4j
settings are in a separate application.groovy
. As far as I understand, Grails merges them into one Configuration Object.
What do I miss in my configuration?