1
0
mirror of https://github.com/google/nomulus synced 2026-01-07 14:05:44 +00:00
Files
nomulus/jetty/logging.properties
Weimin Yu ca072b4861 Add log traces to Nomulus service on GKE (#2427)
* Add log traces to Nomulus service on GKE

Add request-scope log traces to Nomulus on GKE which, unlike
AppEngine and Cloud Run etc, does not generate traces for hosted
applications. This change only affects the GKE image. It does not affect
the AppEngine services.

Log traces are added to Nomulus-generated logs in request-processing
threads. Forked threads are not covered yet. The single relevant use
case (TimeLimiter) will be addressed in a followup PR.

The main change is in the logging configuration:

*  Use gcp-cloud-logging's LoggingHandler

*  Add gcp-cloud-logging's TraceLoggingEnhancer to the handler.

*  Set a thread-local trace id through the TraceLoggingEnhancer in
   ServletBase on request's entry and clear it on completion.

Also removed an unused class (`RequestLogId`).

* CR

* CR
2024-05-07 19:15:46 +00:00

16 lines
653 B
Properties

# Default logging configuration for Nomulus container.
# Use google-cloud-logging's handler
handlers=com.google.cloud.logging.LoggingHandler
com.google.cloud.logging.LoggingHandler.logTarget=STDOUT
com.google.cloud.logging.LoggingHandler.formatter=google.registry.util.GcpJsonFormatter
com.google.cloud.logging.LoggingHandler.enhancers=com.google.cloud.logging.TraceLoggingEnhancer
# Set the default logging level for all loggers to INFO.
.level = INFO
# Turn off logging in Hibernate classes for misleading ERROR-level logs
org.hibernate.engine.jdbc.batch.internal.BatchingBatch.level=OFF
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.level=OFF