GeezerVison is showing github.com — Add ability to disable Cloud logging when running in Development sandbox · Issue #3551 · googleapis/google-cloud-java
Add ability to disable Cloud logging when running in Development sandbox #3551
Description
When running the application in development box, I get below error:
[INFO] 06:12:12,243 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [com.google.cloud.logging.logback.LoggingAppender]
[INFO] 06:12:12,249 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CLOUD]
[INFO] 06:12:13,325 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@6:13 - RuntimeException in Action for tag [appender] java.lang.NullPointerException
[INFO] at java.lang.NullPointerException
[INFO] at at com.google.cloud.MetadataConfig.getZone(MetadataConfig.java:46)
[INFO] at at com.google.cloud.logging.MonitoredResourceUtil.getValue(MonitoredResourceUtil.java:154)
[INFO] at at com.google.cloud.logging.MonitoredResourceUtil.getResource(MonitoredResourceUtil.java:111)
[INFO] at at com.google.cloud.logging.logback.LoggingAppender.getMonitoredResource(LoggingAppender.java:134)
[INFO] at at com.google.cloud.logging.logback.LoggingAppender.start(LoggingAppender.java:180)
[INFO] at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
[INFO] at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
[INFO] at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
[INFO] at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
[INFO] at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
[INFO] at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
[INFO] at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
[INFO] at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
[INFO] at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
[INFO] at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
[INFO] at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
[INFO] at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
[INFO] at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
[INFO] at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
[INFO] at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
[INFO] at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
[INFO] at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32)
[INFO] at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20)
[INFO] at at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32)
At this point, I'm not really sure what should be the fix for this, but, IMHO, the library should be intelligent enough to back-off when not running in Cloud environment. Environment based logback configuration might not be possible under every circumstance.
Activity
ZacWolf commented on Dec 20, 2018
Any update on this? I'm getting this same error. I've tried adding the following environment variable in the server runtime settings:
CLOUDSDK_COMPUTE_REGION
CLOUDSDK_COMPUTE_ZONE
But still getting this nullpointer exception.
ajaaym commented on Jan 11, 2019
This is fixed as part of #4289. Closing this issue. Please feel free to reopen.
Metadata
Metadata
Development
No branches or pull requestsIssue actions