Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
netsvc: [IMP] add json logging #23417
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
Output logs in json format when doing log streaming.
Provide structured and well parsable data by a log forwarder / collector.
Thank you for your contribution, but unfortunately this change is not the right solution for the problem you're trying to solve, and we know this because we parse logs for the runbot, odoo.sh, among other things.
On top of this, pythonjsonlogger is an extra third-party dependency that has no guarantee of being maintained at the same pace as Odoo, not to mention that it seems inactive since Aug 2017.
Perhaps a better idea would be to have some sort of hook to which the server posts status information in a computer-readable format (think of GitHub webhooks), as always, PRs welcome as long as they make sense and are not too intrusive :-)
Have a nice day.
Hi @Elkasitu I understand, I'll probably open another PR to propose an alternative implementation not using an external library, and with a config flag. To see if it probably can convince you...
As to the hook you propose, I associate that with metrics instrumenting like in
It would be interesting to prepare a patch which puts some tracer wrappers around some methods and exposes their CPU time in real time through an instrumented
Question: As to the log parsing, can you share (or think of) a log parser which does parse streaming logs and does not fail on a multi-line traceback?
Disclaimer: I use fluent-bit to forward the logs to a EFK (F for fluent instead of logstash). It is very low on memory, somewhat beta, but a very promising forwarder...
Without intent to sound bold, I'm not entirely sure, if JSON logging in general, it's the wrong solution for the problem I try to solve, though...
The ultimate problem definition: eliminate SPOFs and reduce plumbing.
@Elkasitu Adrian, would you agree to guide me a little to tackle this and underlying issues of script-ability?
I have now the case where: