java - LogBack use MessageFormat -
is possible use messageformat in logback ?
i saw uses slf4j messageformatter, because faster said here: out of curiosity -- why don't logging apis implement printf()-like logging methods?
slf4j uses own message formatting implementation differs of java platform. justified fact slf4j's implementation performs 10 times faster @ cost of being non-standard , less flexible.
the ideia use full stack feature of messageformat that:
object[] arguments = { new integer(7), new date(system.currenttimemillis()), "a disturbance in force" }; string result = messageformat.format( "at {1,time} on {1,date}, there {2} on planet {0,number,integer}.", arguments); output: @ 12:30 pm on jul 3, 2053, there disturbance in force on planet 7. anyone ?
i think answered own question... it's performance issue. if slf4j implementations forced find , parse parameterizations... well.. overhead nobody seems want have in logging system.
Comments
Post a Comment