GCP Structured Logging Python

Viewed 19

I'm trying to generate structured logging from Python so that the JsonPayload contains the following:

{ "time": "2021-03-26T14:04:29.6205983Z", "severity": "ERROR", "message": "Error message with exception", "logging.googleapis.com/trace": "d81c37ff0e3c3e4e8895339d63072753", "logging.googleapis.com/spanId": "82c43540ce41be4f", "logging.googleapis.com/labels": {...}

But I can't find the method of insering these ("timestamp", "severity", "logging.googleapis.com/trace" )values in the JsonPayload. I can see some of them outside of the JsonPayload in "resource"("severity": "ERROR") and "sourceLocation"("timestamp":"2021-03-26T14:04:29.6205983Z"), but I want these in the payload.

0 Answers
Related