views:

337

answers:

3

I would like to do this using java.util.logging if possible, any ideas? thanks.

A: 

Apache log4j

jitter
He wants JUL logging. Try http://www.x4juli.org/ for JUL bindings for log4j. I'd rather suggest that you never start a project that uses log4j, as Logback is better in every way than log4j. SLF4j also contains a JUL to SLF4j bridge ( and JCL and log4j to SLF4j) so you can keep the API you have/are comfortable with.
KitsuneYMG
+2  A: 

It is plain better to NOT use java.util.Logging (JUL) as it is very slow. That being said,
if you must use JUL, you could try using Logback/slf4j. SLF4j includes a module that intercepts JUL and uses Logback instead (Logback is probably the fastest/best logger available.) You could also use xjuli, a log4j to JUL bridge.

If you can use other loggers I recommend using Logback directly over Log4j as Logback is written by the same person who did Log4j, but contains even faster code. (e.g. Logback = Log4j + lessons learned).

KitsuneYMG
+2  A: 

You could give a try at SLF4J.

Simple Logging Facade for Java (SLF4J)

The Simple Logging Facade for Java or (SLF4J) serves as a simple facade or abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time.

Gregory Pakosz