Skip to content

Commit

Permalink
fix: add speciel logging fields section in the doc (#728)
Browse files Browse the repository at this point in the history
Co-authored-by: cindy-peng <cindypeng@google.com>
  • Loading branch information
cindy-peng and cindy-peng authored Dec 11, 2023
1 parent eb6fa66 commit 0b9ad2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .readme-partials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ body: |-
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.
### Special Payload Fields in LogEntry
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.
### LogEntry Labels
If the bunyan log record contains a label property where all the values are strings, we automatically promote that
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ Make sure to add logs to your [uncaught exception](https://nodejs.org/api/proces

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.

### Special Payload Fields in LogEntry

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.

### LogEntry Labels

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

0 comments on commit 0b9ad2b

Please sign in to comment.