Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to stop java util logging from formatting my numbers

Tags:

java

logging

I am using Java Util logging and whenever I do statement like this

logger.log(Level.INFO, "print this number = {0}", number);

it formats my number from 278487683165614 to 278,487,683,165,614

this is extremely annoying while searching through logs.

Can i stop it from doing this ? Please help.

like image 219
Robin Bajaj Avatar asked Nov 16 '12 22:11

Robin Bajaj


1 Answers

The default format isn't what you want, change it like this :

{0,number,#}

EDIT :

Here you have more information about MessageFormatPattern http://docs.oracle.com/javase/1.5.0/docs/api/java/text/MessageFormat.html

like image 84
Alexandre Lavoie Avatar answered Sep 29 '22 11:09

Alexandre Lavoie