Reactor Netty provides wire logging for when the traffic between the peers needs to be inspected.
By default, wire logging is disabled.
To enable it, you must set the logger {wirelogger}
level to DEBUG
and apply the following configuration:
link:{examplesdir}/wiretap/Application.java[role=include]
-
Enables the wire logging
Reactor Netty supports 3 different formatters:
-
{javadoc}/reactor/netty/transport/logging/AdvancedByteBufFormat.html#HEX_DUMP[AdvancedByteBufFormat#HEX_DUMP] - the default
link:./../../reactor-netty-core/src/main/java/reactor/netty/transport/logging/AdvancedByteBufFormat.java[role=include]
-
{javadoc}/reactor/netty/transport/logging/AdvancedByteBufFormat.html#SIMPLE[AdvancedByteBufFormat#SIMPLE]
link:./../../reactor-netty-core/src/main/java/reactor/netty/transport/logging/AdvancedByteBufFormat.java[role=include]
-
{javadoc}/reactor/netty/transport/logging/AdvancedByteBufFormat.html#TEXTUAL[AdvancedByteBufFormat#TEXTUAL]
link:./../../reactor-netty-core/src/main/java/reactor/netty/transport/logging/AdvancedByteBufFormat.java[role=include]
When you need to change the default formatter you can configure it as follows:
link:{examplesdir}/wiretap/custom/Application.java[role=include]
-
Enables the wire logging, {javadoc}/reactor/netty/transport/logging/AdvancedByteBufFormat.html#TEXTUAL[AdvancedByteBufFormat#TEXTUAL] is used for printing the content.