We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Slf4j logs [FAILED toString()] when a StackOverflowError occurs. Except if it occurs in addKeyValue, then the exception is fatal:
[FAILED toString()]
addKeyValue
import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Scratch { private static final Logger log = LoggerFactory.getLogger(Scratch.class); public static void main(String[] args) { log.atInfo().log("{}", new ToStringOverflow()); System.out.println("slf4j could log"); log.atInfo().setMessage("msg with key/value").addKeyValue("key", new ToStringOverflow()).log(); System.out.println("slf4j could log with addKeyValue"); } } class ToStringOverflow { @Override public String toString() { return super.toString() + this.toString(); // deliberately causes StackOverflowError } }
14:28:10.399 [main] INFO pkg -- [FAILED toString()] slf4j could log Exception in thread "main" java.lang.StackOverflowError
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Slf4j logs
[FAILED toString()]
when a StackOverflowError occurs.Except if it occurs in
addKeyValue
, then the exception is fatal:The text was updated successfully, but these errors were encountered: