简体   繁体   English

如何在App Engine Flex Java环境中使用Stackdriver Structured日志记录

[英]How to use Stackdriver Structured Logging in App Engine Flex Java environment

Google App Engine flexible environment automatically pipes stdout and stderr to Stackdriver (Google Cloud Logging). Google App Engine灵活的环境会自动将stdout和stderr传递到Stackdriver(Google Cloud Logging)。 But this only supports plain text log message without any metadata (not even logging levels). 但这仅支持不带任何元数据的纯文本日志消息(甚至不支持日志记录级别)。

I found Logback appender for google cloud logging. 我找到了Google Cloud日志记录的Logback附加程序。

https://cloud.google.com/logging/docs/setup/java https://cloud.google.com/logging/docs/setup/java

But this does not seem to support structured logging yet. 但这似乎还不支持结构化日志记录。 And also, it makes GRPC calls for every log entry under the hood. 而且,它还可以对内部的每个日志条目进行GRPC调用。 So, I wonder how scalable it is (especially compare to current app engine structure which has separate Fluentd agent handles logs). 因此,我想知道它的可扩展性(尤其是与具有单独Fluentd代理处理日志的当前应用程序引擎结构进行比较)。

Is there any out of box or simple solution to send structured log from App Engine to Stackdriver? 是否有任何现成的或简单的解决方案可将结构化日志从App Engine发送到Stackdriver?

It's quite possible to do structured logging in StackDriver logging. 在StackDriver日志记录中非常有可能进行结构化日志记录。 In fact, each individual log entry uses the LogEntry structure . 实际上,每个单独的日志条目都使用LogEntry结构 As you can see it includes severity and metadata. 如您所见,它包括严重性和元数据。

According to the App Engine documentation , the following logs are provided out of the box: 根据App Engine文档的说明 ,以下日志是开箱即用的:

Request logs record requests sent to all App Engine apps. 请求日志记录发送到所有App Engine应用程序的请求。 The request log is provided by default and you cannot opt out of receiving it. 默认情况下提供请求日志,您不能选择不接收它。

App logs record activity by software within the App Engine app. App日志通过App Engine应用程序中的软件记录活动。 The log is provided by default and you cannot opt out of receiving it. 默认情况下提供该日志,您不能选择不接收它。

Runtime logs are provided from the flexible environment using a preinstalled Logging agent. 运行时日志是使用预安装的日志记录代理从灵活环境中提供的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谷歌应用引擎。 堆栈驱动程序。 使用 Java 进行日志记录 - Google App Engine. Stackdriver. Logging with Java 如何使用 Stackdriver Trace 在 App Engine Standard 中创建自定义跨度? - How to use Stackdriver Trace to create custom spans in App Engine Standard? Google App Engine: JAVA command not recognized by Python in Flex environment with Docker (`java` command is not found from this Python process) - Google App Engine: JAVA command not recognized by Python in Flex environment with Docker (`java` command is not found from this Python process) 如何在Google App Engine Flex上获取intelliJ Java项目 - How to get intelliJ Java project on Google App Engine Flex Java中的结构化HTML日志记录 - Structured HTML logging in Java 如何清除应用引擎中的所有内存缓存。 Java环境 - How to clear all memcache in app engine. Java environment 如何在Google App引擎(Java)中使用IMAP - How to use IMAP in Google App engine (Java) 将appengine java上的日志写入stackdriver-logging - writing logs on appengine java to stackdriver-logging GKE 和 Stackdriver:Java 日志记录格式? - GKE & Stackdriver: Java logback logging format? Google App Engine Java中的特定于环境的变量 - Environment Specific Variables In Google App Engine Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM