Skip to content

Commit 0b9ad2b

Browse files
cindy-pengcindy-peng
andauthored
fix: add speciel logging fields section in the doc (#728)
Co-authored-by: cindy-peng <cindypeng@google.com>
1 parent eb6fa66 commit 0b9ad2b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.readme-partials.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ body: |-
8080
8181
You may also want to see the [@google-cloud/error-reporting][@google-cloud/error-reporting] module which provides direct access to the Error Reporting API.
8282
83+
### Special Payload Fields in LogEntry
84+
85+
There are some fields that are considered special by Google cloud logging and will be extracted into the LogEntry structure. For example, `severity`, `message` and `labels` can be extracted to LogEntry if included in the bunyan log payload. These [special JSON fields](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields) will be used to set the corresponding fields in the `LogEntry`. Please be aware of these special fields to avoid unexpected logging behavior.
86+
8387
### LogEntry Labels
8488
8589
If the bunyan log record contains a label property where all the values are strings, we automatically promote that

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ Make sure to add logs to your [uncaught exception](https://nodejs.org/api/proces
162162

163163
You may also want to see the [@google-cloud/error-reporting][@google-cloud/error-reporting] module which provides direct access to the Error Reporting API.
164164

165+
### Special Payload Fields in LogEntry
166+
167+
There are some fields that are considered special by Google cloud logging and will be extracted into the LogEntry structure. For example, `severity`, `message` and `labels` can be extracted to LogEntry if included in the bunyan log payload. These [special JSON fields](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields) will be used to set the corresponding fields in the `LogEntry`. Please be aware of these special fields to avoid unexpected logging behavior.
168+
165169
### LogEntry Labels
166170

167171
If the bunyan log record contains a label property where all the values are strings, we automatically promote that

0 commit comments

Comments
 (0)