You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Hexsel, Gustavo" <gu...@teradact.com> on 2008/06/24 18:31:25 UTC

Log4j Logging

  Hey folks,
 
  quick question: if, according to
http://tomcat.apache.org/tomcat-6.0-doc/logging.html, log4j is the
recommended logger, and Tomcat uses commons-logging, why is log4j not
shipped as the default logger???
 
  I suspect "as Tomcat uses a package renamed logging implementation
which is hardcoded for that logger" is the reason, although I don't
quite understand what it means.

  I've seen mentions of JULI, but not on the logging page above... How
does it fit?  Is it a replacement for log4j?  Is it any better?  Can one
configure something better than the "simple" or "xml" formatters?


    []s Gus


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Log4j Logging

Posted by "Hexsel, Gustavo" <gu...@teradact.com>.
  Cool, that helps!  Sorry about the previous message, I think in my
rage I probably skipped the most important details :)

  Does anyone know any project that has some flexible formatters a la
log4j for java.logging?  SimpleFormatter and that XML formatter are way
too verbose (having the 2 lines per log statement was what drove me
insane in the first place).


    []s Gus





-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, June 24, 2008 10:57 AM
To: Tomcat Users List
Subject: RE: Log4j Logging

> From: Hexsel, Gustavo [mailto:gustavo.hexsel@teradact.com]
> Subject: Log4j Logging

(This must be national logging questions month :-)

> if, according to
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html,
> log4j is the recommended logger

I don't see anything on that page that implies log4j is recommended over
any other mechanism.

> I've seen mentions of JULI, but not on the logging page above...

Read the page again; it's discussed thoroughly in the second half.

> How does it fit?

JULI is an implementation of the commons-logging APIs that is hard-coded
for java.util.logging.

> Is it a replacement for log4j?

Kind of, but really log4j is a replacement for java.util.logging, and
commons-logging is a generalized mechanism that allows use of either
underneath.  JULI merges commons-logging and java.util.logging into one
layer largely to reduce overhead.  It also extends the capabilities of
java.util.logging to increase flexibility.

> Is it any better?  Can one configure something better than the 
> "simple" or "xml" formatters?

It all depends on what your definition of "better" is.  Since JULI is
based on java.util.logging, you can create whatever handlers and
formatters you want and plug them in.  If you're already familiar with
log4j, then perhaps you want to use that instead.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Log4j Logging

Posted by David Fisher <df...@jmlafferty.com>.
It now points to http://tomcat.apache.org/tomcat-4.1-doc/config/logger.html

That's perfect for me.

Thank you very much,
Dave

On Jun 24, 2008, at 3:30 PM, Mark Thomas wrote:

> David Fisher wrote:
>> (3) On the logger FAQ page the Configuration link is dead! http://tomcat.apache.org/tomcat-5.0-doc/config/logger.html 
>>  gives a 404.
>
> Fixed. Note, the FAQ is now on a wiki so anyone who spots an error  
> can just
> fix it.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Log4j Logging

Posted by Mark Thomas <ma...@apache.org>.
David Fisher wrote:
> (3) On the logger FAQ page the Configuration link is dead! 
> http://tomcat.apache.org/tomcat-5.0-doc/config/logger.html gives a 404.

Fixed. Note, the FAQ is now on a wiki so anyone who spots an error can just
fix it.

Mark



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Log4j Logging

Posted by David Fisher <df...@jmlafferty.com>.
>
> (This must be national logging questions month :-)

More like International logging month - everyone upgrading to tomcat  
5.5 or better is forced to confront this issue, many are under a lot  
of pressure, and they don't all read English. The differences are  
subtle and lost in translation.

(1) I submit that this paragraph on http://tomcat.apache.org/tomcat-5.5-doc/logging.html 
  makes people react poorly as it offers nothing except a "gotcha" and  
you got more to learn.

> An important consequence for Tomcat 5.5 is that the <Logger> element  
> found in previous versions to create a localhost_log is no longer a  
> valid nested element of <Context>. Instead, the default Tomcat  
> configuration will use java.util.logging. If the developer wishes to  
> collect detailed internal Tomcat logging (i.e what is happening  
> within the Tomcat engine), then they should configure a logging  
> system such as java.util.logging or log4j as detailed next.

(2) There ought to be a link to some page describing how to convert a  
<Logger> into something useful in Tomcat 5.5.

There is the page http://wiki.apache.org/tomcat/FAQ/Logging but there  
is no link on the logging page to the FAQ.

(3) On the logger FAQ page the Configuration link is dead! http://tomcat.apache.org/tomcat-5.0-doc/config/logger.html 
  gives a 404.

(4) You offer two different methods which is great, but now not only  
is someone who just wants to convert their <Logger> is forced to  
choose between two "unknowns."

So, a table comparing log4j vs JULI for various logging requirements  
would really help. A user could look it over and be more likely to  
know whether they should prefer to try log4j or JULI.

Classloading and where to put jars and why is important.

(5) It looks like Ole is working on some documentation improvements I  
hope these comments will help.

The current state of logging documentation only frustrates the already  
frustrated.

But really thanks - I do like Tomcat.

Regards,
Dave


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


[OT/stupid] Re: Log4j Logging

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

Caldarale, Charles R wrote:
|> From: Hexsel, Gustavo [mailto:gustavo.hexsel@teradact.com]
|> Subject: Log4j Logging
|
| (This must be national logging questions month :-)

Logging too much is bad for the environment. You should recycle your
telephone books instead of cutting down trees.

:p

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhhOR0ACgkQ9CaO5/Lv0PD1ygCeJSdGEQyEwR+Fv0wMr30huoI1
vl4AmgMMruzM+5KIW+Pyn4iIuBTH9Nmq
=nzXn
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Log4j Logging

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Hexsel, Gustavo [mailto:gustavo.hexsel@teradact.com]
> Subject: Log4j Logging

(This must be national logging questions month :-)

> if, according to
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html,
> log4j is the recommended logger

I don't see anything on that page that implies log4j is recommended over any other mechanism.

> I've seen mentions of JULI, but not on the logging page above...

Read the page again; it's discussed thoroughly in the second half.

> How does it fit?

JULI is an implementation of the commons-logging APIs that is hard-coded for java.util.logging.

> Is it a replacement for log4j?

Kind of, but really log4j is a replacement for java.util.logging, and commons-logging is a generalized mechanism that allows use of either underneath.  JULI merges commons-logging and java.util.logging into one layer largely to reduce overhead.  It also extends the capabilities of java.util.logging to increase flexibility.

> Is it any better?  Can one configure something better
> than the "simple" or "xml" formatters?

It all depends on what your definition of "better" is.  Since JULI is based on java.util.logging, you can create whatever handlers and formatters you want and plug them in.  If you're already familiar with log4j, then perhaps you want to use that instead.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org