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
vdk-logging-json: Escape newlines in log messages #121
vdk-logging-json: Escape newlines in log messages #121
Conversation
dc794e3
to
f702746
Compare
Is this the recommended way to handle new lines with JSON parser? That would make multi-line logs harder to consume. Imagine 50 line stack trace on a single line. There should be a way to escape new line but for Kibana/log insight to visualize it. |
The component name is the plugin name : vdk-logging-json: Replace newlines .. |
f702746
to
5280d32
Compare
Dug around a bit and it seems like the recommended way is to escape the backwards slash, i.e. replace \n with \\n. Not sure exactly how that'll get parsed and then visualized in the end, but I'm willing to experiment. |
Can you please add link as a comment in the code to this recommendation. We should consider installing and configuring either locally (minikube) or in our CICD environment to use fluentd. I did install it now (it's easy with helm install) but have no idea how to configure it in any meaningful way to test something . |
5280d32
to
b828044
Compare
…ogging-json The message in logs formatted by the vdk-logging-json now have any newline characters replaced by 4 spaces. This change is made due to how logs are currently parsed by separating at newline characters. Signed-off-by: gageorgiev <gageorgiev@vmware.com>
b828044
to
7c83098
Compare
…ogging-json (#121) The message in logs formatted by the vdk-logging-json now have any newline characters escaped. This change is made due to how logs are currently parsed by separating at newline characters. Signed-off-by: gageorgiev <gageorgiev@vmware.com>
The message in logs formatted by the vdk-logging-json now
have any newline characters replaced by 4 spaces. This change
is made due to how logs are currently parsed by separating
at newline characters.
Testing done: local, pipelines
Before installing plugin:
After installing plugin:
Signed-off-by: gageorgiev gageorgiev@vmware.com