2

If I enable debug logging and use the following configuration, I will get soem kind of hex-dump to the console:

HttpClient.create().wiretap(true);

Shows:

         +-------------------------------------------------+
         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
+--------+-------------------------------------------------+----------------+
|00000000| 49 70 73 6f 20 66 61 63 74 6f 20 69 73 20 61 20 |Ipso facto is a |
|00000010| 4c 61 74 69 6e 20 70 68 72 61 73 65 2c 20 64 69 |Latin phrase, di|
|00000020| 72 65 63 74 6c 79 20 74 72 61 6e 73 6c 61 74 65 |rectly translate|
|00000030| 64 20 61 73 20 22 62 79 20 74 68 65 20 66 61 63 |d as "by the fac|
|00000040| 74 20 69 74 73 65 6c 66 22 2c 5b 31 5d 20 77 68 |t itself",[1] wh|
|00000050| 69 63 68 20 6d 65 61 6e 73 20 74 68 61 74 20 61 |ich means that a|
|00000060| 20 73 70 65 63 69 66 69 63 20 70 68 65 6e 6f 6d | specific phenom|
|00000070| 65 6e 6f 6e 20 69 73 20 61 20 64 69 72 65 63 74 |enon is a direct|
|00000080| 20 63 6f 6e 73 65 71 75 65 6e 63 65 2c 20 61 20 | consequence, a |
|00000090| 72 65 73 75 6c 74 61 6e 74 20 65 66 66 65 63 74 |resultant effect|

Question: how can I tell netty to convert the hex dump just to plain string (eg so that I can see the real json output only)?

And especially the message body is compressed, I'd like to log it uncompressed. But how?

membersound
  • 81,582
  • 193
  • 585
  • 1,120

2 Answers2

1
HttpClient httpClient = HttpClient
 .create()
 .wiretap("reactor.netty.http.client.HttpClient", 
    LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL);

This should give you only the text you need

rwinner
  • 348
  • 3
  • 6
  • 15
0

Found this discussion here including some useful hints: webclient logging

And this useful article baeldung webclient logging

But, be careful: logging human readable will under circumstances have some impact to the reactive approach of streaming data in byte parts...

Bernado
  • 548
  • 1
  • 6
  • 18