You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Add short description about automatic metadata population and redirection of JUL logs to stdout to README.
Refactor code by reversing the use of 'appendComma' parameter's value and renaming `populateMetadata?` vars to make the logic more verbose.
#### Alternative way to ingest logs in Google Cloud managed environments
139
+
140
+
If you use Java logger with the Cloud Logging Handler, you can configure the handler to output logs to `stdout` using
141
+
the [structured logging Json format](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields).
142
+
To do this, add `com.google.cloud.logging.LoggingHandler.redirectToStdout=true` to the logger configuration file.
143
+
You can use this configuration when running applications in Google Cloud managed environments such as AppEngine, Cloud Run,
144
+
Cloud Function or GKE. The logger agent installed on these environments can capture STDOUT and ingest it into Cloud Logging.
145
+
The agent can parse structured logs printed to STDOUT and capture additional log metadata beside the log payload.
146
+
The parsed information includes severity, source location, user labels, http request and tracing information.
147
+
148
+
#### Auto-population of log entrys' metadata
149
+
150
+
LogEntry object metadata information such as [monitored resource](https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource),
151
+
[Http request](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) or
(new ContextHandler()).setCurrentContext(context);
179
+
```
180
+
181
+
* Using [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer).
182
+
If your application uses a Web server based on Jakarta servlets (e.g. Jetty or Tomcat), you can add the servlet initializer
183
+
package to your WAR. The package implements a service provider interface (SPI) for
0 commit comments