[Date Prev][Date Next] [Chronological] [Thread] [Top]

Debug.java and logging in JLDAP



Hello All,

I have been thinking about this for a while.  I've never been too happy with the Debug.java that gets generated on the fly at compile time to support debug messages.  I'd like to replace this setup with a more "java-ish" aproach that uses some kind of runtime desision to making logging move between none and debug.  This takes advantage of java's flexability and keeps from forcing a re-compile whenever someone wants to turn on debugging.  There was a very leangthy discussion on this topic over at apacheds :

http://www.archivum.info/dev@directory.apache.org/2005-06/msg00404.html

I figure there are 3 approaches that can be taken:

1.  Use Java logging
  This is nice because it has been a java standard since 1.4.  This would however break backwards compatability to 1.3 jres (I know they are still fairly prevalent).

2.  User Log4j
  This solution doesn't break backwords compatability, as it has been the defacto standard since the 1.3 days.  It does however require an extra library.

3.  Use a thin wrapper for java logging
  This solution would detect the presence of the java logging framework at runtime, and if it doesn't exist it would just use System.out/System.err.

Any thoughts?