Re: Log any remote request made by httpClient 4.5.x

2020-01-27 Thread Oleg Kalnichevski
On Mon, 2020-01-27 at 16:58 +0100, Tamás Cservenák wrote:
> Oleg,
> 
> wire is "too much" for my use case.
> 
> I basically want an "access log"-like log, but for upstream.
> so method, URL (so, full URL or at scheme + host + port + path) and
> roundtrip time
> (time elapsed when the response line arrived). so to say like "access
> log"
> but on client side.
> 
> This log will most probably be post-processed as well (splunk,
> kibana) for
> later analysis. So,
> the size (contents) and output would need to be configurable by me as
> well.
> 

Disable logging for categories you do not want.

Refer to the `Enable context logging for connection management /
request execution` section as an example

Oleg


> 
> TIA
> T
> 
> On Mon, Jan 27, 2020 at 4:44 PM Oleg Kalnichevski 
> wrote:
> 
> > On Mon, 2020-01-27 at 14:14 +0100, Tamás Cservenák wrote:
> > > Howdy,
> > > 
> > > I'd like to log ANY remote request httpClient 4.5.x does
> > > (stable),
> > > what is
> > > the best way to active that? (like "upstream" request log, so
> > > method
> > > + URL
> > > [schema://hostname/path]).
> > > 
> > > I'd like to cover cases even like httpClient CONNECT requests,
> > > httpClient
> > > retries (if configured to do so) and redirection following (if
> > > configured
> > > to do so).
> > > 
> > > Any existing class or best approach? Any help appreciated.
> > > 
> > 
> > Tamás
> > 
> > Any particular reason for not using HttpClient context and wire
> > logging?
> > 
> > http://hc.apache.org/httpcomponents-client-4.5.x/logging.html
> > 
> > Oleg
> > 
> > 
> > 
> > -
> > 
> > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-h...@hc.apache.org
> > 
> > 


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Log any remote request made by httpClient 4.5.x

2020-01-27 Thread Tamás Cservenák
...also, I wanted to log ALL requests httpclient sends

So ended up with a LoggingRequestExecutor, something like this:
https://gist.github.com/cstamas/6a4165a64348490fa4fcdaa74757c966

but it looks to me like a hack. Also, unsure how to properly collect things
I need (ie. in case of proxy etc)


TIA
T

On Mon, Jan 27, 2020 at 4:58 PM Tamás Cservenák  wrote:

> Oleg,
>
> wire is "too much" for my use case.
>
> I basically want an "access log"-like log, but for upstream.
> so method, URL (so, full URL or at scheme + host + port + path) and
> roundtrip time
> (time elapsed when the response line arrived). so to say like "access log"
> but on client side.
>
> This log will most probably be post-processed as well (splunk, kibana) for
> later analysis. So,
> the size (contents) and output would need to be configurable by me as well.
>
>
> TIA
> T
>
> On Mon, Jan 27, 2020 at 4:44 PM Oleg Kalnichevski 
> wrote:
>
>> On Mon, 2020-01-27 at 14:14 +0100, Tamás Cservenák wrote:
>> > Howdy,
>> >
>> > I'd like to log ANY remote request httpClient 4.5.x does (stable),
>> > what is
>> > the best way to active that? (like "upstream" request log, so method
>> > + URL
>> > [schema://hostname/path]).
>> >
>> > I'd like to cover cases even like httpClient CONNECT requests,
>> > httpClient
>> > retries (if configured to do so) and redirection following (if
>> > configured
>> > to do so).
>> >
>> > Any existing class or best approach? Any help appreciated.
>> >
>>
>> Tamás
>>
>> Any particular reason for not using HttpClient context and wire
>> logging?
>>
>> http://hc.apache.org/httpcomponents-client-4.5.x/logging.html
>>
>> Oleg
>>
>>
>>
>> -
>> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
>> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>>
>>


Re: Log any remote request made by httpClient 4.5.x

2020-01-27 Thread Tamás Cservenák
Oleg,

wire is "too much" for my use case.

I basically want an "access log"-like log, but for upstream.
so method, URL (so, full URL or at scheme + host + port + path) and
roundtrip time
(time elapsed when the response line arrived). so to say like "access log"
but on client side.

This log will most probably be post-processed as well (splunk, kibana) for
later analysis. So,
the size (contents) and output would need to be configurable by me as well.


TIA
T

On Mon, Jan 27, 2020 at 4:44 PM Oleg Kalnichevski  wrote:

> On Mon, 2020-01-27 at 14:14 +0100, Tamás Cservenák wrote:
> > Howdy,
> >
> > I'd like to log ANY remote request httpClient 4.5.x does (stable),
> > what is
> > the best way to active that? (like "upstream" request log, so method
> > + URL
> > [schema://hostname/path]).
> >
> > I'd like to cover cases even like httpClient CONNECT requests,
> > httpClient
> > retries (if configured to do so) and redirection following (if
> > configured
> > to do so).
> >
> > Any existing class or best approach? Any help appreciated.
> >
>
> Tamás
>
> Any particular reason for not using HttpClient context and wire
> logging?
>
> http://hc.apache.org/httpcomponents-client-4.5.x/logging.html
>
> Oleg
>
>
>
> -
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>


Re: Log any remote request made by httpClient 4.5.x

2020-01-27 Thread Oleg Kalnichevski
On Mon, 2020-01-27 at 14:14 +0100, Tamás Cservenák wrote:
> Howdy,
> 
> I'd like to log ANY remote request httpClient 4.5.x does (stable),
> what is
> the best way to active that? (like "upstream" request log, so method
> + URL
> [schema://hostname/path]).
> 
> I'd like to cover cases even like httpClient CONNECT requests,
> httpClient
> retries (if configured to do so) and redirection following (if
> configured
> to do so).
> 
> Any existing class or best approach? Any help appreciated.
> 

Tamás

Any particular reason for not using HttpClient context and wire
logging?

http://hc.apache.org/httpcomponents-client-4.5.x/logging.html

Oleg



-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Log any remote request made by httpClient 4.5.x

2020-01-27 Thread Tamás Cservenák
Howdy,

I'd like to log ANY remote request httpClient 4.5.x does (stable), what is
the best way to active that? (like "upstream" request log, so method + URL
[schema://hostname/path]).

I'd like to cover cases even like httpClient CONNECT requests, httpClient
retries (if configured to do so) and redirection following (if configured
to do so).

Any existing class or best approach? Any help appreciated.

TIA
T


[ANNOUNCEMENT] HttpComponents Client 5.0 beta7 (GA candidate) released

2020-01-27 Thread Oleg Kalnichevski
The Apache HttpComponents project is pleased to announce 5.0-beta7
release of HttpComponents Client. 

This BETA release upgrades HttpCore to the latest version  and
addresses a number of issues found since the previous BETA release.

Notable changes and features in the 5.0 series:
---

* Support for the HTTP/2 protocol and conformance to requirements and
recommendations of the latest HTTP/2 protocol specification documents
(RFC 7540, RFC 7541.)

  Supported features:

** HPACK header compression
** Stream multiplexing (client and server)
** Flow control
** Response push
** Message trailers
** Expect-continue handshake
** Connection validation (ping)
** Application-layer protocol negotiation (ALPN)
** TLS 1.2 security features

* Improved conformance to requirements and recommendations of the
latest HTTP/1.1 protocol specification documents (RFC 7230, RFC 7231.)

* New connection pool implementation with lax connection limit
guarantees and better performance under higher concurrency due to
absence of a global pool lock.

* Package name space changed to 'org.apache.hc.client5'.

* Maven group id changed to 'org.apache.httpcomponents.client5'.

HttpClient 5.0 releases can be co-located with earlier major versions
on the same classpath due to the change in package names and Maven
module coordinates.

Download - 
Release notes - <

https://www.apache.org/dist/httpcomponents/httpclient/RELEASE_NOTES-5.0.x.txt
> 

HttpComponents site - 

About HttpComponents HttpClient

The Hyper-Text Transfer Protocol (HTTP) is perhaps the most significant
protocol used on the Internet today. Web services, network-enabled
appliances and the growth of network computing continue to expand the
role of the HTTP protocol beyond user-driven web browsers, while
increasing the number of applications that require HTTP support.

Although the java.net package provides basic functionality for
accessing resources via HTTP, it doesn't provide the full flexibility
or functionality needed by many applications. HttpClient seeks to fill
this void by providing an efficient, up-to-date, and feature-rich
package implementing the client side of the most recent HTTP standards
and recommendations.

Designed for extension while providing robust support for the base HTTP
protocol, HttpClient may be of interest to anyone building HTTP-aware
client applications such as web browsers, web service clients, or
systems that leverage or extend the HTTP protocol for distributed
communication.



-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org