Skip to content

Logger.error does not print suppressed exceptions #832

@simon04

Description

@simon04

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

import org.tinylog.Logger;

public class TinylogTest {

    public static void main(String[] args) {
        try {
            Exception e = new Exception("e");
            e.addSuppressed(new RuntimeException("e1"));
            e.addSuppressed(new RuntimeException("e2"));
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println();
            Logger.error(e);
        }

    }
}

Console output is

java.lang.Exception: e
	at TinylogTest.main(TinylogTest.java:7)
	Suppressed: java.lang.RuntimeException: e1
		at TinylogTest.main(TinylogTest.java:8)
	Suppressed: java.lang.RuntimeException: e2
		at TinylogTest.main(TinylogTest.java:9)

2025-09-23 11:28:15 [main] TinylogTest.main()
ERROR: java.lang.Exception: e
	at TinylogTest.main(TinylogTest.java:7)

Java's Exception.printStackTrace() nicely prints the two suppressed exceptions RuntimeException: e1 and RuntimeException: e2

Tinylog does not output anything regarding RuntimeException: e1 or RuntimeException: e2

Environment
tinylog version: 2.7.0
Java version: 25

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions