You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mick Knutson <mi...@hotmail.com> on 2003/05/29 20:34:49 UTC

[OT] Logging per class or system?

I have seen in the archives, details about how to specify debug for, say 
Digester, but info for xerces.
I have only seen examples of lines to add, but not sure where to add them, 
or examples of them.

Does anyone have an example of commons logging that will set different 
levels for different classes/systems?

Thanks...

Mick Knutson

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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


Re: [OT] Logging per class or system?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 29 May 2003, Mick Knutson wrote:

> Date: Thu, 29 May 2003 11:34:49 -0700
> From: Mick Knutson <mi...@hotmail.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: [OT] Logging per class or system?
>
> I have seen in the archives, details about how to specify debug for, say
> Digester, but info for xerces.
> I have only seen examples of lines to add, but not sure where to add them,
> or examples of them.
>
> Does anyone have an example of commons logging that will set different
> levels for different classes/systems?
>

There are three important things to remember:

* The actual configuration mechanism you use (i.e. what file
  to update) depends on what logging implementation you're using,
  not on commons-logging.  You'll need to consult the docs for
  that logging implementation to learn about what the file is
  and what the syntax is.

* Most Jakarta-based apps that use commons-logging follow a
  convention that the "logger name" is the fully qualified
  name of the containing class.  So, the logger for BeanUtils
  instance is named "org.apache.commons.beanutils.BeanUtils".
  You'll need to consult the source code for your particular
  classes, or their docs, to find out what naming convention
  is in use.

* Most logging systems (in particular JDK 1.4 and Log4J both
  support this) have a notion of hierarchical names, so you
  can configure -- say -- "org.apache.commons" to be DEBUG and
  it would affect all the Commons libraries, unless there was
  a more detailed setting for a particular subpackage or class.

I use JDK 1.4 logging, and currently have the following settings in my
$JAVA_HOME/jre/lib/logging.properties file:

  org.apache.commons.level = INFO
  org.apache.struts.level = INFO
  org.apache.struts.action.RequestProcessor.level = FINEST

because I wanted trace-level output from RequestProcessor, but info level
output from everything else in Struts and the commons packages.

> Thanks...
>
> Mick Knutson
>

Craig

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