You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Rahul P Akolkar <ak...@us.ibm.com> on 2005/03/04 07:06:24 UTC

Logging

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). 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.

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
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.

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.

Thanks!
-Rahul

Re: Logging

Posted by Henri Yandell <fl...@gmail.com>.
On Sun, 6 Mar 2005 20:46:44 -0500, Rahul P Akolkar <ak...@us.ibm.com> wrote:
> -- Henri wrote: --
> 
> > Been a while, but I'm pretty sure that the released log taglib (1.0)
> > uses log4j,
> <snip>
> > Shouldn't be that hard to release a 2.0 of the log taglib. Or 1.0 of a
> > commons-logging taglib (rename the existing one), and maybe a 1.0 of a
> > UGLI taglib.
> <snap>
> > logging.apache.org do have their UGLI (or something..JULI?) interface
> > which is a competitor to clogging now.
> 
> This is great, I'd be very happy with the second option you propose: 1.0s
> of both clogging and UGLI. I suspect having the freedom to choose between
> the two will be appreciated by many JSP/taglib developers down the road.

Makes sense. Some suggestion of bringing the UGLI and JCL groups
together, but unsure if that'll happen or not.
 
> For my bit, I'm happy to contribute to either or both. [it seems you have
> most of it done already for clogging ;-)]

Search and replace rocks :) Unsure how we would maintain separate UGLI
and JCL versions.

Working out the patches needed for UGLI-support (instead of JCL) would
be very useful. Then we could try and figure out whether to have 2
branches, 2 modules, 2 packages in the same module etc.

Hen

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


Re: Logging

Posted by Rahul P Akolkar <ak...@us.ibm.com>.
-- Henri wrote: --

> Been a while, but I'm pretty sure that the released log taglib (1.0)
> uses log4j,
<snip>
> Shouldn't be that hard to release a 2.0 of the log taglib. Or 1.0 of a
> commons-logging taglib (rename the existing one), and maybe a 1.0 of a
> UGLI taglib.
<snap>
> logging.apache.org do have their UGLI (or something..JULI?) interface
> which is a competitor to clogging now.

This is great, I'd be very happy with the second option you propose: 1.0s 
of both clogging and UGLI. I suspect having the freedom to choose between 
the two will be appreciated by many JSP/taglib developers down the road.

For my bit, I'm happy to contribute to either or both. [it seems you have 
most of it done already for clogging ;-)]

-Rahul

Re: Logging

Posted by Henri Yandell <fl...@gmail.com>.
On Fri, 4 Mar 2005 14:28:54 -0500, Rahul P Akolkar <ak...@us.ibm.com> wrote:
> Martin,
> 
> Thanks for your input. I'm not trying to re-invent anything, the last
> thing we need is a new "logging abstraction" ;-)
> 
> > 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.
> 
> Are you sure? I dropped taglibs-log.jar in WEB-INF/lib and visited this
> JSP:
> 
> <%@ taglib prefix="log" uri="http://jakarta.apache.org/taglibs/log-1.0"%>
> <log:info>Lets hope we don't have any other dependency!</log:info>
> 
> to be greeted with:
> 
> java.lang.NoClassDefFoundError: org/apache/log4j/Priority
> 
> Not sure where the log4j default assumption came from.

Been a while, but I'm pretty sure that the released log taglib (1.0)
uses log4j, while the current CVS HEAD was changed to use whatever
version of commons-logging was available at the time.

(I didn't write the taglib, but I did do the release and the change to
clogging).


> 2) If the above log4j dependency is true, then the usage of the log taglib
> within the rdc taglib has already bound the rdc-based app developer to
> log4j (for the one log argument). Personal preference is one thing, I
> definitely would not want to insist on a log4j dependency for all RDC
> based apps.

Shouldn't be that hard to release a 2.0 of the log taglib. Or 1.0 of a
commons-logging taglib (rename the existing one), and maybe a 1.0 of a
UGLI taglib.

> > On every project I have worked on that uses JDK 1.4 as a minimum,
> > we have used Log4j over JDK logging.
> 
> Over JDK logging? I'm interested in knowing what taglib you used for your
> JSP logging.
> 
> > 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. ;-)
> <snip>
> > Anything that works with Commons Logging works with JDK 1.4 logging
> > already.
> 
> Well, am sure some of our friends are working on that ;-) I am not
> interested in debating which one is better, I've gone through reviews and
> now-famous blog postings ;-) But I do want the choice as a taglib author!
> I do not see the JDK option being available at all, and if that is indeed
> the case, maybe its time to change that.

logging.apache.org do have their UGLI (or something..JULI?) interface
which is a competitor to clogging now.

Hen

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


Re: Logging

Posted by Rahul P Akolkar <ak...@us.ibm.com>.
Martin,

Thanks for your input. I'm not trying to re-invent anything, the last 
thing we need is a new "logging abstraction" ;-) 

> 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.

Are you sure? I dropped taglibs-log.jar in WEB-INF/lib and visited this 
JSP:

<%@ taglib prefix="log" uri="http://jakarta.apache.org/taglibs/log-1.0"%>
<log:info>Lets hope we don't have any other dependency!</log:info>

to be greeted with:

java.lang.NoClassDefFoundError: org/apache/log4j/Priority

Not sure where the log4j default assumption came from.

> 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.

Thats seems fair enough, but its hard to find a one-sided coin these days 
;-) So:

1) I suspect most times the app author wouldn't want to be involved in the 
internal logging from a taglib (in fact, it may be more of a hindrance in 
most cases due to the proliferation of log statements), and a taglib 
author has orthogonal interests.
2) If the above log4j dependency is true, then the usage of the log taglib 
within the rdc taglib has already bound the rdc-based app developer to 
log4j (for the one log argument). Personal preference is one thing, I 
definitely would not want to insist on a log4j dependency for all RDC 
based apps.

> On every project I have worked on that uses JDK 1.4 as a minimum,
> we have used Log4j over JDK logging.

Over JDK logging? I'm interested in knowing what taglib you used for your 
JSP logging.

> 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. ;-)
<snip>
> Anything that works with Commons Logging works with JDK 1.4 logging
> already. 

Well, am sure some of our friends are working on that ;-) I am not 
interested in debating which one is better, I've gone through reviews and 
now-famous blog postings ;-) But I do want the choice as a taglib author! 
I do not see the JDK option being available at all, and if that is indeed 
the case, maybe its time to change that.

-Rahul

Re: Logging

Posted by Martin Cooper <mf...@gmail.com>.
On Fri, 4 Mar 2005 01:06:24 -0500, Rahul P Akolkar <ak...@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