Skip to content
Discussion options

You must be logged in to vote

To add a ready-to-use implementation of the JsonProvider SPI that @xstefank mentioned (Quarkus 3.36+):

Implement JsonProvider to merge the stacktrace into the message field:

import io.quarkus.logging.json.runtime.JsonProvider;
import jakarta.json.stream.JsonGenerator;
import org.jboss.logmanager.ExtLogRecord;
import java.io.PrintWriter;
import java.io.StringWriter;

public class StackTraceInMessageProvider implements JsonProvider {

    @Override
    public void writeTo(JsonGenerator generator, ExtLogRecord record) {
        String message = record.getFormattedMessage();
        Throwable thrown = record.getThrown();

        if (thrown != null) {
            StringWriter sw = new StringW…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@agreedSkiing
Comment options

@xstefank
Comment options

@agreedSkiing
Comment options

Comment options

You must be logged in to vote
2 replies
@agreedSkiing
Comment options

@MILLERMARRU
Comment options

Answer selected by agreedSkiing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants