Skip to content

Conversation

@multani
Copy link
Owner

@multani multani commented Sep 3, 2023

Extra keys are not added to logging.googleapis.com/labels as it's some kind of special (I'll add a formatter to add extra labels in there).

Instead, the extra keys are simply added as extra JSON keys when formatted to stdout, and they will be picked up by Google Cloud Logging and added as extra keys into the final Cloud Logging event's jsonPayload key

Only downside: when there are no extra keys, Cloud Logging simply put the log message into textPayload and not into jsonPayload.message.

Extra keys are not added to `logging.googleapis.com/labels` as it's some
kind of special (I'll add a formatter to add extra labels in there).

Instead, the extra keys are simply added as extra JSON keys when formatted
to stdout, and they will be picked up by Google Cloud Logging and added as
extra keys into the final Cloud Logging event's `jsonPayload` key

Only downside: when there are no extra keys, Cloud Logging simply put the
log message into `textPayload` and not into `jsonPayload.message`.
@multani multani added bug Something isn't working enhancement New feature or request labels Sep 3, 2023
@multani multani self-assigned this Sep 3, 2023
@multani multani merged commit fca29b6 into main Sep 3, 2023
@multani multani deleted the extra-keys branch September 3, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants