log4j or java.util's logger which is the best to use .. already this question is thr but i did get clear idea..
can any one help me out ...
log4j or java.util's logger which is the best to use .. already this question is thr but i did get clear idea..
can any one help me out ...
I doubt that there will be consensus on this, both get the job done. The real answer is of course "it depends ...", the idea of "best" depends so heavily on your particular requirements.
I take the following thought process:
My perception is that log4j is more widely used and hence I'd expect item 2 above to lead more often to log4j.
Personally, so long as logging is being done intelligently I don't much care what package is used. Anything beats System.out.println().
IMO, the only real advantage of java.util.logging
is that it is present in all Java SE platforms (since Java 1.4).
Log4j is more flexible and easier to configure using configuration files. I think I've heard claims that it is faster too ... but I cannot cite any sources.