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
pretty logs with docker #178
Comments
I have no idea what the output of |
yes - can we see some sample output Are you saying that you're logging with pino in processes, wrapped in containers, and then using |
@davidmarkclements exactly Here is the raw docker-compose log
Here is when the logger uses
And here is when I pipe docker-compose to pino, as you can see the output is not formatted.
So really it's only the prefix that's the issue that makes it invalid json in this case. |
Personally, I think that's a use case outside of the scope of the prettifier. The prettifier is mean to parse newline delimited JSON. This input is not that. |
@jsumners Yeah adding something specific to docker for Maybe I'll publish another module that strips docker logs prior to piping to Anyways, thanks and closing issue. |
I agree - I think that's the best approach @JamesKyburz (unless there's a way with docker-compose to modify the logging). Another option would be to see if there's an alternative to docker-compose for aggregating docker logs (@mcollina actually wrote something along those lines I think, before the API's changed though) In any event what would be really nice, once you've written it to add it to the docs, because this doesn't just work with prettifying, it works with transports as well I think it's worth documenting Also - we can help with the perf side of things once built if you like |
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When running
docker-compose logs -f | pino -l
nothing is formatted.I got it working when I stripped everything prior to first "{"
Before sending a
PR
fixing this was after tips so I don't break other formatters :)The text was updated successfully, but these errors were encountered: