Enabling HTTP request/response logging in Liberty
The following Liberty configuration, potentially added into the configDropins
directory as a separate file, can be used to enable HTTP request logging:
<server>
<featureManager>
<feature>monitor-1.0</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint">
<accessLogging filepath="/logs/http_defaultEndpoint_access.log" logFormat='%h %i %u %t "%r" %s %b' />
</httpEndpoint>
</server>
If you haven’t already installed the monitor-1.0 feature, you’ll first have to also:
/opt/ibm/liberty/wlp/bin/installUtility install monitor-1.0
(See Editing files in Liberty Docker containers if you’re wanting to do this in a running Docker Liberty container.)