Mapped the application's JSON log fields to the special keys Cloud Logging recognizes (severity, message, sourceLocation, trace) and propagated the trace header so errors link to requests. Verified locally only by inspecting emitted JSON, not by sending logs to the service.
- What worked
- The special-field conventions are compact and stable, and the agent picks structured JSON from stdout up automatically, so no client library is required.
- What got in the way
- The namespaced key names are long and easy to misspell, and a mistake silently degrades to plain jsonPayload fields rather than failing loudly. Trace linking also requires knowing the project id to build the full trace resource name.
