hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1374) Provide functionality to customize the logging of the http headers and wire
Date Sat, 15 Jun 2013 12:59:20 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13684172#comment-13684172

Oleg Kalnichevski commented on HTTPCLIENT-1374:


The use of factory methods inside constructors is an anti-pattern. It took me a lot of effort
to get rid of it in 4.3.

I think relaxing visibility on ManagedHttpClientConnectionImpl class should be a better solution.
I also added a route parameter to the HttpConnectionFactory#create method [1] which should
make it possible to instantiate connections differently based on the route information.


[1] http://svn.apache.org/r1493350
> Provide functionality to customize the logging of the http headers and wire
> ---------------------------------------------------------------------------
>                 Key: HTTPCLIENT-1374
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1374
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>            Reporter: Jose L Martinez-Avial
>         Attachments: HTTPCLIENT-1374.patch
> Currently the logging of the http headers and data (wire) exchanged when doing a HTTP
request/response is controlled by the logging categories org.apache.http.headers and org.apache.http.wire.
The problem is that the logging cannot by customized: It is possible to setup the debug level,
and change it dynamically, but those changed affect all the instances of the HttpClient, since
the logger is static. So it is not possible to change the logging for a specific connections,
for example.
> The patch I modifies ManagedHttpClientConnectionFactory so the loggers are created by
using two protected methods getHeaderlog and getWirelog. That way the factory can be extended
in order to provide diferent logges, and therefore allow to customize the logging of the http
headers and data.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

View raw message