Use of 'grails.logging.jul.usebridge' in grails config.groovy

6.7k Views Asked by At

I am a newbie for log4j and sl4j, I am using grails 2.0.4 and in config.groovy there is a line

grails.logging.jul.usebridge = false for prod

&

grails.logging.jul.usebridge = true for dev

I followed this article, As it says that use of grails.logging.jul.usebridge is to implement the swapping logic of logging frameworks such as

  • log4j
  • java.util.logging
  • commons logging
  • logback

Is this the only use of grails.logging.jul.usebridge in config.groovy, or is there any other uses

And one more question

  1. which is the recommended logging framework to use in production environment
1

There are 1 best solutions below

3
On

I definitely recommend you using Log4j. It has no dependencies and is tested (or even included) in various web app servers. You can configure it easily via DSL in Config.groovy or in separate config file in production environment.

Both commons-logging and SLF4J are wrappers for Log4j and use it underneath.

The grails.logging.jul.usebridge = true is used to put java.util.logging through SLF4J, as described here.