You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Tamás Cservenák <ta...@cservenak.net> on 2020/01/27 13:14:46 UTC
Log any remote request made by httpClient 4.5.x
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
Re: Log any remote request made by httpClient 4.5.x
Posted by Oleg Kalnichevski <ol...@apache.org>.
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 <ol...@apache.org>
> 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-unsubscribe@hc.apache.org
> > For additional commands, e-mail:
> > httpclient-users-help@hc.apache.org
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: Log any remote request made by httpClient 4.5.x
Posted by Tamás Cservenák <ta...@cservenak.net>.
...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 <ta...@cservenak.net> 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 <ol...@apache.org>
> 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-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
Re: Log any remote request made by httpClient 4.5.x
Posted by Tamás Cservenák <ta...@cservenak.net>.
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 <ol...@apache.org> 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-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
Re: Log any remote request made by httpClient 4.5.x
Posted by Oleg Kalnichevski <ol...@apache.org>.
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-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org