Skip to content

Structured logging (JSON) #464

Closed
Closed
@jbub

Description

@jbub

Is your feature request related to a problem? Please describe.
Its pretty common these days to emit structured logs instead of textual logs. Its easier to parse and some cloud environments already has support for parsing and indexing them. My problem is mainly with GKE, textual logs to stderr/stdout are by default logged with severity of ERROR which is not really great as that brings a lot of noise.

Describe the solution you'd like
Ability to switch to json logging, a severity field would decide the level of the logged message. Example logged message:

{
  "severity":"INFO",
  "message":"Hello world.",
  "time":"2020-10-12T07:20:50.52Z"
}

https://cloud.google.com/logging/docs/structured-logging

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions