You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "David M. Karr" <dm...@earthlink.net> on 2002/07/31 07:24:37 UTC

Quick guide to using debug logging in unit tests?

Could someone give me a concise pointer to figuring out exactly how logging
would work in unit tests built like the Struts tags unit tests?  I'm using
"LogFactory" to get a "Log" and calling "log.debug(...)", but I realize that
I'm unsure how I actually turn on logging, or control it (outside of code).
Does "LogFactory" and "Log" have anything to do with the "<Logger>" element
defined in the "conf/test/server.xml" file?  I was hoping to use the
"SystemOutLogger" class, so I could just see debugging output on stdout.  I
added a "<Logger>" element specifying this class (with a "verbosity" of "4"),
in ADDITION to the "FileLogger".  The result was that I saw lots more
information coming to stdout, but not my "log.debug(...)" lines.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Quick guide to using debug logging in unit tests?

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

On 30 Jul 2002, David M. Karr wrote:

> Date: 30 Jul 2002 22:24:37 -0700
> From: David M. Karr <dm...@earthlink.net>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: struts-dev@jakarta.apache.org
> Subject: Quick guide to using debug logging in unit tests?
>
> Could someone give me a concise pointer to figuring out exactly how logging
> would work in unit tests built like the Struts tags unit tests?  I'm using
> "LogFactory" to get a "Log" and calling "log.debug(...)", but I realize that
> I'm unsure how I actually turn on logging, or control it (outside of code).
> Does "LogFactory" and "Log" have anything to do with the "<Logger>" element
> defined in the "conf/test/server.xml" file?  I was hoping to use the
> "SystemOutLogger" class, so I could just see debugging output on stdout.  I
> added a "<Logger>" element specifying this class (with a "verbosity" of "4"),
> in ADDITION to the "FileLogger".  The result was that I saw lots more
> information coming to stdout, but not my "log.debug(...)" lines.
>

Like all Commons packages, commons-logging is primarily documented in its
Javadocs -- especially the package description for the
org.apache.commons.logging package:

  http://jakarta.apache.org/commons/logging/api/

(It has nothing to do with the <Logger> element, which is a Tomcat thing.)

Craig


> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>