<div dir="ltr">Is it possible to use MessageFormat in logback ?<br><br>I saw that it uses slf4j MessageFormat*ter*, because its faster as said here: <a href="http://stackoverflow.com/questions/8635769/out-of-curiosity-why-dont-logging-apis-implement-printf-like-logging-metho">http://stackoverflow.com/questions/8635769/out-of-curiosity-why-dont-logging-apis-implement-printf-like-logging-metho</a><br>
<br> SLF4J uses its own message formatting implementation which differs from that of the Java platform. This is justified by the fact that SLF4J's implementation performs about 10 times faster but at the cost of being non-standard and less flexible.<br>
<br>The ideia is to use the full stack feature of MessageFormat like that:<br><br> Object[] arguments = {<br> new Integer(7),<br> new Date(System.currentTimeMillis()),<br> "a disturbance in the Force"<br>
};<br><br> String result = MessageFormat.format(<br> "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",<br> arguments);<br><br> output: At 12:30 PM on Jul 3, 2053, there was a disturbance<br>
in the Force on planet 7.<br><br>anyone ?<br></div>