Repository navigation
Logging to root handler doesn't work #3220
Description
Activity
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.
on May 2, 2018 I'm unable to reproduce this. Could you try doing this at startup?
for (Handler handler : Logger.getLogger("").getHandlers()) { System.err.println(handler); }
On my machine, this properly prints
com.google.cloud.logging.LoggingHandler@6b0d80edsignifying that the handler is registered. (The6b0d80edis irrelevant here.)@pongad verified there are no root loggers:
Logger rootLogger = Logger.getLogger(""); System.err.println("# Root handlers = " + rootLogger.getHandlers().length); for (Handler handler : rootLogger.getHandlers()) { System.err.println(handler); }And from the logs:
# Root handlers = 0Just to make sure, are you both running the same version of the
google-cloud-logginglibrary?@meltsufin Thank you for taking a look. I am running
1.28.0. I'm confused how this is happening though, since IIUC the logic to read and logging configuration file isn't ingoogle-cloud-logging. My current suspicion is that the tomcat runtime is doing something funny, but I'm completely willing to be told I'm wrong.@pongad The logging configuration is loaded by Tomcat itself. The runtime is not really doing anything with it. We do have a sample app that actually registers a root handler that may aid with debugging.
@meltsufin @pongad I'm using
1.14.0(on account of #3219) :)@meltsufin @pongad seeing the same thing with
1.28.0as well.@papudesi From investigating this, I don't think the problem is with the client lib. Does this problem occur in any other runtime? (Tomcat was never GA and now deprecated; the runtime team encourages you to move to Jetty runtime.)
It seems the issue has been resolved here. Please ask for reopen if not.
- added a commit that references this issue
on Mar 9, 2026
We use tomcat-runtime, and our logging.properties looks like this:
Adding something like
org.apache.handlersworks, just not for the root handler.