-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Allow removal of stacktrace newlines in logging #6262
Comments
@antoninarq the new The issue you report is not on the logging system but on the collection system (fluentd here) that is not capable or configured for multiline. The workaround you suggested is ... a workaround :) |
Same issue will happen with
Right now the solution seems to be to either completely move out from using Quarkus or develop our own solutions to switch logging to use log4j which supports "%replace" - including access-log and other built in logs. Is there any other way? |
@sfrank-mc can you explain what is the issue with |
Pertaining to this issue - if i use |
Is there any plan to tackle this? |
The stacktraces are only one case of multi-line logs, so this would only be a workaround at best. Trying to list different approaches to solve the multi-line logs problem:
|
Thanks @rquinio |
Note: the same thing is an issue for AWS CloudWatch. We need to replace \n with \r for it to handle to messages correctly. |
I am encountering a similar issue: trying to send the logs to fluentd using socket logging. I cannot use
This has put me in a dead end and think I might need to switch jboss-logging for something else, for example logback with the
|
It seems to me that this could be easily solved if there were a way to configure the line separator used in JBoss LogManager. I've raised an issue: https://issues.redhat.com/browse/LOGMGR-302 Personally, I'd love to see this for use in writing native lambdas with Quarkus. Using any of the alternative approaches for structured logging adds too much overhead. |
Just for the record: I found a solution for my specific usecase. You can now register custom log filters, which get passed every |
Description
When you want to format logs in JSON (to be sent to an EFK cluster), we can use this log format pattern :
However, exception stacktraces will be printed with newlines, which prevent the logs to be cleanly viewed as the log collector will collect each line separately.
Implementation ideas
A way to print the stack trace with newlines replaced by
\n
as text for stacktrace.That could be done with a new log pattern symbol like
%e
or with the support of operator like%replace
for logback (see this stackoverflow issue).The text was updated successfully, but these errors were encountered: