[slf4j-dev] [JIRA] (SLF4J-400) Guard exception that can occur when converting a message to a string
QOS.CH (JIRA)
noreply-jira at qos.ch
Fri Mar 17 09:19:00 CET 2017
Ken Kwon created SLF4J-400:
------------------------------
Summary: Guard exception that can occur when converting a message to a string
Key: SLF4J-400
URL: https://jira.qos.ch/browse/SLF4J-400
Project: SLF4J
Issue Type: Improvement
Components: log4j-over-slf4j
Affects Versions: 1.7.25
Environment: * OS : any
* JDK : 1.8 (or any)
Reporter: Ken Kwon
Assignee: SLF4J developers list
Attachments: Sample1.zip
An exception may occur when converting a message to a string([log4j-over-slf4j/src/main/java/org/apache/log4j/Category.convertToString method|https://github.com/qos-ch/slf4j/blob/master/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java#L330]).
For example, someone implements message class's toString method incorrect.
Reprodution steps are described as sample project.
Download the project and run command in your console(or IDE) 'mvn clean test', then you can see the test case is failed.
I think it is better to ignore the exception and let the Category(Logger) continue to run - for example, if the exception is occured , then slf4j prints the exception and continues to call appenders with null message object.
As an idea to resolve this problem,
I've modified the slf4j's Category.java code and pull-requested to your slf4j repo([https://github.com/qos-ch/slf4j/pull/175|https://github.com/qos-ch/slf4j/pull/175]).
Could you comment on this issue?
--
This message was sent by Atlassian JIRA
(v7.3.1#73012)
More information about the slf4j-dev
mailing list