Skip to content

structured logging: print structured logs to stdout #553

@minherz

Description

@minherz

Is your feature request related to a problem? Please describe.
In some cases ingesting logs directly to Cloud Logging by using Logging.write() of the client library does not work well. In its synchronous configuration the process may cause performance penalties to log intensive applications. In the asynchronous configuration some of the logs can be lost when the application runs in the Cloud environment that may experience transient failures or unexpected shutdowns. The "application" here also means a Cloud Function code.
Google Cloud provides logging agents in most of its environments (GCE requires explicit installation and configuration of the agent). The agents are capable of capturing output to STDOUT and ingesting it as log entries (per line). It can be used to delegate the log ingestion task from the application to the agent and resolve the performance problem and a potential lose of logs due to application termination.

Describe the solution you'd like
Add a configuration that will let to redirect the output of the LoggingAppender to stdout instead of calling Logging.write() API and ingesting directly to Cloud Logging.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/java-logging-logback API.lang: javaIssues specific to Java.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions