Has anyone gotten log4j and grails to play nice?

While basic configuration of log4j in Grails can be tricky, I’ve managed to get down the basic configuration with no real problem. I don’t have an issue with the appenders and all that, I can still can’t seem to get the different environments to work.

In the Grails docs, it says you can configure log4j for the different environments like you can anything else. Well, that never seems to work. Whatever I have set up for production ALWAYS overrides development. I’ve tried it several ways and the result it always the same. This sucks because for production I like to have the settings for my controllers set to info instead of debug, and errors go out via an SMTP appender.

I’ve read that the prop files won’t be generated in version 1.1, but surely this has got to work now? Anyone??

No TweetBacks yet. (Be the first to Tweet this post)


Don’t miss anything, subscribe!

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

In my case, log4j works well by following configuration:

environments {
development {
log4j {

}
}
test {
log4j {

}
}
production {
log4j {

}
}
}

yep, tried that. the production config always ends up overriding the development one.

yep, that should work (the code from the first comment)

[...] I always had mixed results with logging settings in different environments. Turns out this site was the worst. However I like [...]

Leave a comment

(required)

(required)