hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject RE: Post Method - Content Length Header
Date Sat, 07 Jan 2006 10:32:38 GMT
On Fri, 2006-01-06 at 16:08 -0600, Gerdes, Tom wrote:
> Is there an example source code that shows exactly how to set up the
> wire log.  I looked at the web site and it shows system properties to
> set.  I did set them in my application.  Although, I do not seem to be
> getting the level of detail that I would like.  
> 
> Here is a snippet of my code...  is this setup right?
> 
> import org.apache.commons.httpclient.*;
> import org.apache.commons.httpclient.HttpClient;
> import org.apache.commons.httpclient.HttpState;
> import org.apache.commons.httpclient.HttpStatus;
> import org.apache.commons.httpclient.HttpMethodBase;
> import org.apache.commons.httpclient.cookie.CookiePolicy;
> import org.apache.commons.httpclient.cookie.CookieSpec;
> import org.apache.commons.httpclient.cookie.MalformedCookieException;
> import org.apache.commons.httpclient.methods.GetMethod;
> import org.apache.commons.httpclient.methods.multipart.*;
> import org.apache.commons.httpclient.methods.PostMethod;
> import org.apache.commons.httpclient.methods.RequestEntity;
> import org.apache.commons.httpclient.methods.StringRequestEntity;
> import org.apache.commons.httpclient.Cookie.*;
> import org.apache.commons.httpclient.params.*;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import java.io.*;
> import java.util.*;
> import java.lang.String.*;
> import java.lang.Integer.*;
> import java.lang.Long.*;
> 
> public class BANKMIJ
> {
> 
>  static String host = "127.0.0.1";
>  static int port = 443;
>  static String className = "BANKMIJ";
>  static Log logger = LogFactory.getLog(className);
> 
-----------------------^

This statement executed before the 'main' method

Tom, make sure you properly configure commons-logging PRIOR to
instantiating the Log instance. I personally always set these system
properties on the command line primarily to avoid situations like this
one

java -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug

Hope this helps

Oleg

>  public static void main(String[] argv) throws Exception
>  {
> 
>   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");
> 
> 
>  
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Thursday, January 05, 2006 3:21 PM
> To: HttpClient Project
> Subject: Re: Post Method - Content Length Header
> 
> Gerdes, Tom wrote:
> > (1) I am running a standalone application not using Websphere.  Output
> > is not directed to a file.  
> >  
> 
> Then simple log should work. We will not be able to help you unless you 
> manage to produce a wire log of the HTTP session.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 


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


Mime
View raw message