[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Debug.java and logging in JLDAP
- To: openldap-devel@OpenLDAP.org
- Subject: Debug.java and logging in JLDAP
- From: Marc Boorshtein <mboorshtein@gmail.com>
- Date: Mon, 12 Sep 2005 07:17:42 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=ae6ctZyLPoI0skRpcIffFyeKc8ZB/ClEZcBA7q0vAZ5lovns0mYTiJj2vNz2rBcB7K0tYTHa1r+YIfN/nxjELsFYhiuvWsDlzh3Y6FWgGLpj4y05hVGrsFnbCkWjQgCztN8jP/U6G4biMqniluaujCPvaVbo8zrRLbsWNMChqOM=
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?