Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Labels:None
-
Environment:Mac OSX
-
Number of attachments :2
Description
Prior to Grails 1.1 (at least through 1.0.4), the Log4j configuration could be modified through additional log4j closures in external configuration files. This allowed developers to customize log4j for their own development sandbox (environments 'development' and 'test') without affecting the logging of any other developer or a CI build/test/run cycle.
The Grails 1.1 Log4j DSL appears to fatally fail, quietly, and abort processing of an external config if the config contains ANY
{log4j}DSL.
The attached example simply takes the 'appenders' example from the standard Config.groovy and moves it to an external configuration file.
println "log4j-external-config-config: loading" println "log4j-external-config-config: done"
Here's the output when grails run-app is executed:
kgentle@zeta $ grails run-app
Welcome to Grails 1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Library/Grails/Versions/1.1.0
Base Directory: /Users/kgentle/Workspaces/IntelliJ IDEA 8.1/log4j-external-config
Running script /Library/Grails/Versions/1.1.0/scripts/RunApp.groovy
Environment set to development
log4j-external-config-config: loading
Running Grails application..
Server running. Browse to http://localhost:8080/log4j-external-config
However, adding the following to {{$
{user.home}/.grails/log4j-external-config-config.groovy}} causes the processing of the external configuration to fail - the trailing println is not executed.
println "log4j-external-config-config: loading" log4j { appenders { console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') } } println "log4j-external-config-config: done"
Here's the output when grails run-app is executed:
kgentle@zeta $ grails run-app
Welcome to Grails 1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Library/Grails/Versions/1.1.0
Base Directory: /Users/kgentle/Workspaces/IntelliJ IDEA 8.1/log4j-external-config
Running script /Library/Grails/Versions/1.1.0/scripts/RunApp.groovy
Environment set to development
log4j-external-config-config: loading
Running Grails application..
Server running. Browse to http://localhost:8080/log4j-external-config
Note the missing 'log4j-external-config-config: done'
Needless to say, the log4j configuraiton is not changed in any way.
-
Hide
- log4j-external-config-bug-report-17032009.zip
- 17/Mar/09 6:57 AM
- 19 kB
- Ken Gentle
-
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/Config.groovy 3 kB
- grails-app/conf/DataSource.groovy 0.6 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/conf/spring/resources.groovy 0.0 kB
- grails-app/i18n/messages.properties 3 kB
- grails-app/i18n/messages_de.properties 3 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 2 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/.../messages_pt_BR.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_th.properties 5 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/views/error.gsp 2 kB
- grails-app/views/index.gsp 0.9 kB
- grails-app/views/layouts/main.gsp 0.7 kB
- test/reports/TESTS-TestSuites.xml 0.1 kB
- test/reports/html/all-tests.html 0.8 kB
- test/reports/html/allclasses-frame.html 0.4 kB
- test/reports/html/alltests-errors.html 0.8 kB
- test/reports/html/alltests-fails.html 0.9 kB
- test/reports/html/index.html 0.7 kB
- test/reports/html/overview-frame.html 0.4 kB
- test/reports/html/overview-summary.html 2 kB
- test/reports/html/stylesheet.css 0.9 kB
-
- log4j-external-config-config.groovy
- 17/Mar/09 6:57 AM
- 0.2 kB
- Ken Gentle