ViliusS commented on code in PR #3586:
URL: https://github.com/apache/logging-log4j2/pull/3586#discussion_r2024891715


##########
log4j-layout-template-json/src/main/resources/GcpLayout.json:
##########
@@ -1,13 +1,18 @@
 {
-  "timestamp": {
+  "timestampSeconds": {
     "$resolver": "timestamp",
-    "pattern": {
-      "format": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
-      "timeZone": "UTC",
-      "locale": "en_US"
+    "epoch": {
+      "unit": "secs",
+      "rounded": true
     }
   },
-  "severity": {
+  "timestampNanos": {
+    "$resolver": "timestamp",
+    "epoch": {
+      "unit": "secs.nanos"
+    }
+  },
+  "logging.googleapis.com/severity": {

Review Comment:
   From explanation 
[here](https://github.com/GoogleCloudPlatform/ops-agent/issues/1920#issuecomment-2772380200)
 it looks like this depends how you send the logs to Google Cloud Logging.
   If Ops Agent is used, you should use `logging.googleapis.com/severity` OR 
use `severity` and adjust it later in Ops Agent pipeline as described in this 
example 
https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration#example_configuration_2.
   If log is generated into the file and then send to Google Cloud Logging 
directly from Java, for example using Spring GCP libraries, then it must be 
`severity`.
   
   I think I'm going to revert this to `severity` because there is a workaround 
for Ops Agent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to