Skip to content

Commit

Permalink
chore: comment about how to instantiate logger variable in Cloud Run (G…
Browse files Browse the repository at this point in the history
…oogleCloudPlatform#9340)

This App.java is referenced in https://cloud.google.com/run/docs/samples/cloudrun-manual-logging#cloudrun_manual_logging-java. But the document does not explain how to instantiate and configure the logger variable.

https://cloud.google.com/run/docs/logging#run_manual_logging-java has the answer. So let's add the explanation in the source code comment.
  • Loading branch information
suztomo authored and Rafael Rodrigues committed May 27, 2024
1 parent f97340d commit 6501c8b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public static void main(String[] args) {
// -- End log correlation code --

// Create a structured log entry using key value pairs.
// For instantiating the "logger" variable, see
// https://cloud.google.com/run/docs/logging#run_manual_logging-java
logger.error(
"This is the default display field.",
kv("component", "arbitrary-property"),
Expand Down

0 comments on commit 6501c8b

Please sign in to comment.