Closed
Description
Attempting to follow the instructions in README.md
to add the LoggingHandler via logging.properties it seems this always fails as of v3.6.0 with a NullPointerException due to the change introduced in bb25d5d. With a no-arg constructor, options will be null and line 244 will fail to call the getAutoPopulateMetadata()
on that null reference.
To be able to the the mechanism where qualified classnames of subclasses to java.util.logging.Handler
are added to a handlers
property in logging.properties
, a public no-arg constructor needs to be available. There is also a code example with a no-arg constructor in README.md
Steps to reproduce:
- Add a call
new LoggingHandler()
anywhere, for example in a unit test and run it
Expected outcome:
No exception raised
Actual outcome:
A NullPointerException is raised:
java.lang.NullPointerException
at com.google.cloud.logging.LoggingHandler.<init>(LoggingHandler.java:244)
at com.google.cloud.logging.LoggingHandler.<init>(LoggingHandler.java:193)
at com.google.cloud.logging.LoggingHandler.<init>(LoggingHandler.java:162)