On Thu, 29 May 2003, Mick Knutson wrote:

> Date: Thu, 29 May 2003 11:34:49 -0700
> From: Mick Knutson <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to