-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a colorizeObjects option to disable object colorization #403
Add a colorizeObjects option to disable object colorization #403
Conversation
I'm confused. Why are you sending the output of |
6718390
to
8554b4a
Compare
Pull Request Test Coverage Report for Build 4262969590
💛 - Coveralls |
@jsumners I wish Papertrail would work just as well on JSON logs as it does on formatted logs. But it works much better with formatted logs. As I mentioned, it displays colorized logs output in a web UI. It doesn't have any way to present JSON logs nicely, so you have to send it formatted log output for it to be usable. 😕 I found the |
We don't need to merge this. I can just use the fork for now and see what comes out of the Papertrail support ticket. Also, I understand that this change doesn't really align with the JSON logger philosophy: Disabling the colors on objects is really just muddying the separation of data and presentation (we're using some part of the presentation as data). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
(Note that you shouldn't really do what you are doing for the optimal production setup) |
@jsumners PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full documentation is missing. I would imagine it should go between the current lines 59 and 60 of the readme.
This allows log parsers that can detect JSON at the end of a log line to do so without being thrown off by ANSI colors.
8554b4a
to
5ef89c7
Compare
I also heard back from Papertrail. They say it'll take a lot to fix on their end, and they proposed that a change to pino-pretty might be the easiest. |
Of course they will put the onus on the open source community. They have zero incentive to improve their product. |
This allows log parsers that can detect JSON at the end of a log line to do so without being thrown off by ANSI colors.
Specifically, we're using Pino + Pino Pretty with Papertrail. Papertrail has this feature where they parse JSON at the end of a line. But their JSON parser fails to do so when that JSON is surrounded by ANSI codes.
I could disable colorization altogether, but Papertrail does nicely present ANSI colored logs in their web-UI, so I don't want to do that.
I've sent the Papertrail devs a message, because I think it'd be nicest if it were solved on their side, but as a plan B, and for the time being, this is the next best solution.