Use of 'grails.logging.jul.usebridge' in grails config.groovy
Asked Answered
C

1

10

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
Chirpy answered 29/8, 2012 at 6:52 Comment(0)
M
7

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.

Mother answered 15/10, 2012 at 19:39 Comment(3)
It should be noted however that official documentation warns about the performance issues of using grails.logging.jul.usebridge = true in production environments: * slf4j web site and * Grails web siteRichy
Please note: SLF4J is not a "log4j wrapper" in any way, shape or form. These are dang lies. SLF4J is a logging API that has a binding for log4j (if that's what you choose to use), but also has bindings for lots of other things: logback, JUL, JCL, etc.Cloaca
as @DavidRiccitelli said it had caused serious performance issues on our production servers. Set it to false resolved the problem.Wholewheat

© 2022 - 2024 — McMap. All rights reserved.