I just switched my project from JUL (java.util.logging) to SL4J over JUL. Everything works great, I only have one grievance: when logging, the timestamps are not very relevant to me, for example:
2 [pool-2-thread-1] INFO com.lexit.server.ServerContext - Context initialized.
703 [pool-2-thread-1] INFO com.lexit.server.ServerContext - Connection with database succesful.
1144 [pool-2-thread-1] INFO com.lexit.server.ServerContext - External emails will be sent
1144 [pool-2-thread-1] INFO com.lexit.server.ServerContext - Alarms will be sent fr
1146 [pool-2-thread-1] INFO java.lang.Class - Adding reccuring timer with id: 1234567
How can I configure SL4J to have more relevant timestamps (e.g. 8-Mar-2012 5:38:00 PM)??
That’s the logging format emitted by SLF4J’s
SimpleLogger.See for yourself at:
http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html
SimpleLoggeris the logger that gets used when you haven’t added one of the SLF4J “bridge” jars to your classpath. Make sure you addslf4j-jdk14-x.x.x.jar(the JUL bridge) to your classpath, so that SLF4J will be configured to bridge to JUL.