Difference in using java.util.logging and Log4j Loggers

GuruKulki picture GuruKulki · Feb 13, 2010 · Viewed 8.6k times · Source

I am developing a java application for which i have to use a logging mechanism. And now i am confused to choose either java libraries logger or to go for Log4j logger.

So i want to know when i can go for java logger and when i can go for log4j logger.

Answer

Esko picture Esko · Feb 13, 2010

I'd suggest you go with SLF4J instead to decouple your application from specific logging frameworks. It has adapters for various popular logging frameworks such as Jakarta Logging, JDK1.4 logging, log4j etc. making it a good abstraction for logging needs.