Search code examples
javaloggingtinylog

tinylog is formatting ordinary numbers like money


I'm using tinylog inside glassfish for logging my web service requests. here is a log statement:

Logger.info("record received from user: {0}, stationAxisId: {1}. inserted with recordId: {2}. server timestamp: {3}", username, stationAxisId, res.recordId, res.timeStamp);

the problem is stationAxisId which is integer. but what I see in the log file is:

addNewRecord-INFO-record received from user: kia, stationAxisId: 10,543,201. inserted with recordId: 56. server timestamp: 1391/07/04 13:55:35.348

It is formatting stationAxisIs like money. How can I fix it?


Solution

  • tinylog uses MessageFormat internally, so see second answer to this: How do I format a long integer as a string without separator in Java?