entur / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
25 stars 10 forks source link

Fix SLF4J/JUL configuration #92

Closed vpaturet closed 3 years ago

vpaturet commented 3 years ago

OTP manages log messages through the SLF4J logging framework and uses LogBack as a concrete logger implementation. However some third-party libraries used by OTP output log messages through Java Unified Logging (JUL). These log messages should be redirected to SLF4J using the jul-slf4j bridge, but this is currently not functional in OTP1. This results in log messages at INFO level being output to stderr and interpreted by StackDriver as ERROR-level messages Examples: When the OTP1 graph builder starts, the following messages are output to stderr: INFO: Database closed INFO: dataFileCache open start

Root cause:

  1. HSQLDB reconfigure JUL at startup time. --> This can be disabled by setting the system property: -Dhsqldb.reconfig_logging=false See this other PR for a fix: https://github.com/entur/otp-deployment-config/pull/26

2 The initialisation of SLF4J is ignored because it runs too late in the startup process (https://github.com/entur/OpenTripPlanner/blob/46d04264dea8886604f23689329e5cd1f2d84888/src/main/java/org/opentripplanner/standalone/OTPApplication.java#L39) --> SLF4J should be initialized in OTPMain. This is the purpose of this PR.