Skip to content

Allow json output for logging (not access logs) #15020

@howardjohn

Description

@howardjohn

This is a recreation of #13636, which was closed due to #13832. While that PR got closer, it is still not possible to get full JSON log output as far as I can tell. %_ just makes new lines escaped, but may still result in invalid JSON.

For example, with a log format of {"level":"%l","time":"%Y-%m-%dT%T.%fZ","scope":"envoy %n","msg":"%_"}:
I will get logs like:
{"level":"warning","time":"2021-02-10T14:45:45.640752Z","scope":"envoy config","msg":"StreamAggregatedResources gRPC config stream closed: 14, connection error: desc = "transport: Error while dialing dial tcp [::1]:15012: connect: connection refused""}

This is not valid JSON as the quotes in the message are not escaped.
cc @dio

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions