Open
Description
Description
When you want to format logs in JSON (to be sent to an EFK cluster), we can use this log format pattern :
quarkus.log.console.format={"@timestamp": "%d{yyyy-MM-dd'T'HH:mm:ss.SSS}", "level": "%p", "loggerName": "%C", "message": "%s", "stackTrace":"%e" }%n
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment