java.lang.Object
io.helidon.http.http1.Http1LoggingConnectionListener
- All Implemented Interfaces:
DataListener<SocketContext>,Http1ConnectionListener
Connection listener that logs all exchanged information.
-
Method Summary
Modifier and TypeMethodDescriptioncreate(HttpLogConfig config, String prefix) Create a log connection listener for HTTP/1.1 communication.voiddata(SocketContext ctx, byte[] data, int position, int length) Data received or sent.voiddata(SocketContext ctx, BufferData data) Data received or sent.booleanenabled()Whether this listener is enabled.voidheaders(SocketContext ctx, Headers headers) Handle headers.voidprologue(SocketContext ctx, HttpPrologue prologue) Handle prologue.voidstatus(SocketContext ctx, Status status) Handle status (server response only).
-
Method Details
-
create
Create a log connection listener for HTTP/1.1 communication. Logger name is based on the configured logger name, or it uses this class, with theprefixappended to it.Example: Webclient logger for sent data:
io.helidon.http.http1.Http1LoggingConnectionListener.client.send- Parameters:
config- configuration of the HTTP protocolprefix- prefix of the log, and suffix of the logger name- Returns:
- a new connection listener
-
enabled
public boolean enabled()Description copied from interface:Http1ConnectionListenerWhether this listener is enabled. If set tofalseconstruction of intermediate objects may be skipped as well as a method invocation on this listener.- Specified by:
enabledin interfaceHttp1ConnectionListener- Returns:
- whether this listener is enabled
-
prologue
Description copied from interface:Http1ConnectionListenerHandle prologue.- Specified by:
prologuein interfaceHttp1ConnectionListener- Parameters:
ctx- contextprologue- prologue
-
headers
Description copied from interface:Http1ConnectionListenerHandle headers.- Specified by:
headersin interfaceHttp1ConnectionListener- Parameters:
ctx- contextheaders- headers
-
status
Description copied from interface:Http1ConnectionListenerHandle status (server response only).- Specified by:
statusin interfaceHttp1ConnectionListener- Parameters:
ctx- contextstatus- status
-
data
Description copied from interface:DataListenerData received or sent.- Specified by:
datain interfaceDataListener<SocketContext>- Parameters:
ctx- contextdata- data
-
data
Description copied from interface:DataListenerData received or sent.- Specified by:
datain interfaceDataListener<SocketContext>- Parameters:
ctx- contextdata- byte arrayposition- position within the byte arraylength- number of bytes
-