OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.14k stars 588 forks source link

Ability to exclude urls from access logs #15613

Open jpfloresibm opened 3 years ago

jpfloresibm commented 3 years ago

Is your feature request related to a problem? Please describe. WLP has the ability to record inbound http requests via access logging. However there are some endpoints that we wish to not generate logs for. An example would be endpoints that we use internally for k8s liveness/readiness.. Because we do not have the ability to exclude these endpoints the logs become quite polluted (since we call these endpoints very frequently).

Describe the solution you'd like It would be extremely useful to add the ability to exclude certain urls from access logging to avoid unnecessary log pollution from these internal endpoints.

Describe alternatives you've considered None

Additional context Sample server.xml config with excluded url list

<httpEndpoint host="*" httpPort="-1" httpsPort="9443" id="defaultHttpEndpoint">
<accessLogging logFormat='%h %H %A%B %m %p %q %{R}W %s %U %i %u %t &quot;%r&quot; %D' excludedUris='/mdm/cache/v0/liveness*,/mdm/cache/v0/readiness*'/>
</httpEndpoint>
<logging jsonAccessLogFields="logFormat"/>
benmoeARZ commented 3 years ago

This Feature would be very nice! Automatic requests to liveness/readiness/metrics from k8s spam the logs. This would give the ability to filter these paths from accessLogging