tinylog正在格式化普通数字,如金钱

时间:2012-09-25 10:36:02

标签: java logging tinylog

我在glassfish中使用tinylog来记录我的Web服务请求。这是一个日志声明:

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

问题是stationAxisId是整数。但我在日志文件中看到的是:

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

格式stationAxisIs就像金钱一样。我该如何解决?

1 个答案:

答案 0 :(得分:1)

tinylog在内部使用MessageFormat,因此请参阅第二个答案:How do I format a long integer as a string without separator in Java?