You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Robert Stagner <re...@usa.net> on 2004/05/22 00:44:59 UTC
Logging messages to a file
I'm new to this list, so forgive me if my question seems a bit off
topic. I'm in the midst of developing an application using
commons-httpclient, and I've integrated the following code to include
debug level logging:
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
"true");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
"debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
With this code in place, I'm receiving the expected debug level messages
at the console. However, my question is this....is there any way to
redirect this output to a file using some sort of system property
(similar to those used above)?? How could this be done??
Regards,
Rob
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: Logging messages to a file
Posted by Michael Becke <be...@u.washington.edu>.
Hi Rob,
Commons logging (the logging framework used by HttpClient) does not
natively support anything more complicated than just writing to
console. Fortunately it can make use of other logging systems like
log4j or java.util.logging. Please take a look at the commons-logging
site <http://jakarta.apache.org/commons/logging/> and log4j
<http://logging.apache.org/log4j/docs/> for some more detail.
Mike
On May 21, 2004, at 6:44 PM, Robert Stagner wrote:
> I'm new to this list, so forgive me if my question seems a bit off
> topic. I'm in the midst of developing an application using
> commons-httpclient, and I've integrated the following code to include
> debug level logging:
>
> System.setProperty("org.apache.commons.logging.Log",
> "org.apache.commons.logging.impl.SimpleLog");
> System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
> "true");
> System.setProperty("org.apache.commons.logging.simplelog.log.httpclient
> .wire", "debug");
> System.setProperty("org.apache.commons.logging.simplelog.log.org.apache
> .commons.httpclient", "debug");
>
> With this code in place, I'm receiving the expected debug level
> messages at the console. However, my question is this....is there any
> way to redirect this output to a file using some sort of system
> property (similar to those used above)?? How could this be done??
>
> Regards,
> Rob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org