Closed anthonator closed 1 month ago
@anthonator I think we can accept encoder_opts
in the formatters and pass that to Jason, so that you can set: encoder_opts: [pretty: true]
.
I'm using the Elastic formatter and I'm simply piping my application's output through ecslog
to get it pretty-printed during development. Usage is as simple as mix run | ecslog
@AndrewDryga apologies, but are you saying this already exists or would be good to implement? I'm not seeing :encoder_opts
in the documentation or code so I'm assuming the former. Is that correct?
@anthonator I'm sorry - my message was a bit ambiguous, I meant that it would be nice to add it, a PR would be welcome :).
@AndrewDryga thank you for clarifying!
A pretty print option would be helpful since JSON logs can be hard to grok visually. I'm currently working on setting up JSON logging and it's been a bit of a pain to try and verify everything.
Jason's formatter does support pretty print so hopefully it wouldn't be too difficult.
I'd be willing to contribute this feature if it's something you're interested in supporting.