jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject Re: Logging
Date Fri, 04 Mar 2005 18:08:52 GMT
On Fri, 4 Mar 2005 01:06:24 -0500, Rahul P Akolkar <akolkar@us.ibm.com> wrote:
> The RDC sandbox tag library uses JSP 2.0 tag files for most of its tag
> implementations. As I move towards a beta release, I think we need more
> options for logging (maybe a new tag library).
> I looked at the log (supported) taglib, but I think the commons-logging
> and log4j dependencies are not appealing as a taglib author (plus its
> 1.0).

As I understand it, the only dependency is Commons Logging. Log4j is
optional - you only need it if that's the particular logging
implementation you want to use.

> While the log taglib is great for logging in JSPs, and the RDC
> taglib itself uses commons-logging (only for the sample apps), I think
> logging in tag files is a different beast.

I disagree that it's a different beast. You still want the log
messages from tags to end up in the same place as the rest of your log
messages. Otherwise, it's going to be hard to sync up two different
logs when you're trying to identify a problem. So you really want one
log, and hence one logging mechanism.

> As a tag file author, one would hope to:
> 1) Add no new dependencies for logging that get pushed out to every webapp
> that uses the tag(lib)
> 2) Have a logging scheme that can exist amicably with whatever logger(s)
> the app author chooses to use

This is exactly what Commons Logging is for. I don't honestly see how
you're going to achieve the same goal without either using that or
reinventing it.

> 3) Check the status of logging within servlet containers
> I see an effort in Tomcat towards JDK 1.4 logging (with JULI), and if that
> is any indicator, I think the servlet containers are doing their best to
> catch up on any slack that Java logging left behind. It seems that the
> Java logging APIs might be the best bet here.

On every project I have worked on that uses JDK 1.4 as a minimum, we
have used Log4j over JDK logging. It is simply so much better in terms
of functionality, ease of use, ease of configuration, flexibility,
etc. As Ceki (Mr. Log4j) and others have said many times, JDK 1.4
logging is like they based it on Log4j concepts but left out the good
parts. ;-)

> I'd be interested in opinions about logging, specifically w.r.t tag files.
> I also wonder how much interest there is in a variant of the log taglib
> that uses JDK 1.4 logging? I looked at the source, if we keep it as
> light-weight as the current log taglib, it shouldn't be too much effort.

Anything that works with Commons Logging works with JDK 1.4 logging
already. I would strongly encourage you to use the existing logging
taglib - with exhancements if they're necessary for what you need -
rather than reinventing the wheel.

Martin Cooper

> Thanks!
> -Rahul

To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org

View raw message