Skip to content

Allow removal of stacktrace newlines in logging #6262

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 \nas text for stacktrace.
That could be done with a new log pattern symbol like %e or with the support of operator like %replacefor logback (see this stackoverflow issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions