我们想在Google App-Engine标准环境中运行基于Spring-Boot的其余后端。除了日志记录之外,其他所有东西都工作正常。我们找不到所有应用程序日志的“平面”视图。我们发现我们的应用程序日志分组在日志request_log
中。
我们正在使用SLF4J记录日志(借助lomboks @ Slf4j注释,但这没关系)。
我们尝试遵循此Google How-to Guide,以便为Stackdriver Logging设置Logback附加程序。
现在,该应用程序无法正常启动。在第一个请求下,我们仅在相应的request_log
条目下获得以下日志语句。
2018-11-05 13:27:54.726 MEZ
[h~<google-project-id>/<instance-id>].<stderr>: SLF4J: A number (121) of logging calls during the initialization phase have been intercepted and are
2018-11-05 13:27:54.726 MEZ
[h~<google-project-id>/<instance-id>].<stderr>: SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.
2018-11-05 13:27:54.726 MEZ
[h~<google-project-id>/<instance-id>].<stderr>: SLF4J: See also http://www.slf4j.org/codes.html#replay
2018-11-05 13:27:55.399 MEZ
[h~<google-project-id>/<instance-id>].<stdout>:
2018-11-05 13:37:42.166 MEZ
[h~<google-project-id>/<instance-id>].<stdout>: . ____ _ __ _ _
2018-11-05 13:37:42.320 MEZ
[h~<google-project-id>/<instance-id>].<stdout>: /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2018-11-05 13:37:42.321 MEZ
[h~<google-project-id>/<instance-id>].<stdout>: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2018-11-05 13:37:42.834 MEZ
Uncaught exception from servlet
com.google.apphosting.runtime.HardDeadlineExceededError: This request (00000166e3d7f348) started at 2018/11/05 12:27:52.520 UTC and was still executing at 2018/11/05 12:37:42.812 UTC.
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:469)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:76)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:62)
at com.google.cloud.logging.LoggingImpl.flush(LoggingImpl.java:544)
at com.google.cloud.logging.LoggingImpl.write(LoggingImpl.java:526)
at com.google.cloud.logging.logback.LoggingAppender.append(LoggingAppender.java:201)
at com.google.cloud.logging.logback.LoggingAppender.append(LoggingAppender.java:63)
at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:84)
at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:270)
at ch.qos.logback.classic.Logger.callAppenders(Logger.java:257)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.log(Logger.java:765)
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
at java.util.logging.Logger.log(Logger.java:738)
at com.google.apphosting.runtime.NullSandboxPlugin$LogStream.flush(NullSandboxPlugin.java:604)
at java.io.PrintStream.flush(PrintStream.java:338)
at com.google.apphosting.runtime.NullSandboxPlugin$LogPrintStream.println(NullSandboxPlugin.java:468)
at org.springframework.boot.SpringBootBanner.printBanner(SpringBootBanner.java:49)
at org.springframework.boot.SpringApplicationBannerPrinter.print(SpringApplicationBannerPrinter.java:71)
at org.springframework.boot.SpringApplication.printBanner(SpringApplication.java:563)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:155)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:135)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:140)
at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:63)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:330)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp(AppEngineWebAppContext.java:159)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doStart(AppEngineWebAppContext.java:116)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:243)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:181)
at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:109)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:699)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:661)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:631)
at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:825)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:273)
at java.lang.Thread.run(Thread.java:745)
似乎,因为Spring-Boot无法正确启动。我们缺少什么?