Skip to content

Commit 3f55be6

Browse files
authored
rename trace field for googleCloudLogging (#183)
1 parent 9c727b3 commit 3f55be6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

helper.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ func SetWithConfig(level string, config *LogConfig) error {
7070
} else if config.googleCloudLogging {
7171
logger.Formatter = &logrus.JSONFormatter{
7272
FieldMap: logrus.FieldMap{
73+
// https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields
7374
logrus.FieldKeyTime: "timestamp",
7475
logrus.FieldKeyLevel: "severity",
7576
logrus.FieldKeyMsg: "message",
77+
"trace": "traceID", // Trace is special in GCE so we have to use another name.
7678
},
7779
TimestampFormat: time.RFC3339Nano,
7880
}

0 commit comments

Comments
 (0)