【问题标题】:Google Cloud Platform Log Viewer logs truncate jsonPayload message for error logGoogle Cloud Platform 日志查看器记录截断错误日志的 jsonPayload 消息
【发布时间】:2021-01-01 13:45:37
【问题描述】:

我在日志查看器中查看的日志正在截断有效负载的“消息”部分,但有效负载的“异常”部分没有限制并显示整个堆栈跟踪。这些日志是针对我在 Google Cloud 中运行的服务中捕获的异常。

该服务是使用 Spring Boot 构建的,使用 SLF4J 作为记录器工厂。我使用 SLF4J 的 LoggerFactory 根据调用它的类创建记录器,当捕获到异常时,我使用记录器的 error("Exception thrown processing this message: ${message.data}", exception) 进行记录,其中 message 的类型为 com.google.pubsub.v1.PubsubMessage 和 exception是 java.lang.Exception 类型的 Throwable。

【问题讨论】:

  • 您是如何注意到截断的?您是否尝试过使用其他浏览器或使用隐身模式?这是为了验证浏览器的缓存不会导致这种截断。

标签: spring-boot google-cloud-platform slf4j google-cloud-pubsub google-cloud-logging


【解决方案1】:

我遇到了同样的问题。 唯一的方法是跳转到 Logs Explore 并观看日志。

【讨论】:

    猜你喜欢
    • 2017-08-15
    • 2012-09-12
    • 2020-02-21
    • 1970-01-01
    • 2019-12-29
    • 2019-12-13
    • 1970-01-01
    • 1970-01-01
    • 2019-10-15
    相关资源
    最近更新 更多