-
Notifications
You must be signed in to change notification settings - Fork 337
Closed
Description
common/log supports a json formatter for the log output, which common/promlog does not. Would a PR to add a flag for switching between json/plain text be acceptable? This would make it much easier to integrate exporters etc into environments which mandate structured logging (vs having an extra binary to rewrite the logs).
go-kit already has the necessary NewJSONLogger function, which could be conditionally used instead of NewLogfmtLogger into here:
Lines 58 to 63 in c7de230
| func New(al AllowedLevel) log.Logger { | |
| l := log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) | |
| l = level.NewFilter(l, al.o) | |
| l = log.With(l, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) | |
| return l | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels