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
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:
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.