My bad - AccessLogValve also supports that feature too

   - *%{xxx}r* write value of ServletRequest attribute with name xxx (escaped
   if required, value ?? if request is null)

https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Logging

-Tim


On Fri, Jan 26, 2024 at 7:23 AM Tim Funk <funk...@apache.org> wrote:

> It depends on what you are trying to accomplish. ExtendedAccessLogValve is
> a
> little more flexible where you can write out arbitrary request
> attributes but still format the request like the standard access
> log. So you could have a filter set the value and not need to
> write your own access logger.
>
> -Tim
>
> On Fri, Jan 26, 2024 at 5:47 AM Manak Bisht <manak18...@iiitd.ac.in>
> wrote:
>
>> Hi,
>> I am trying to extend the AccessLogValve to modify logging behaviour for
>> certain URLs. However, I don't have access to the request object in the
>> AccessLogValve API. So, I am left with regex matching on the
>> CharArrayWriter
>> message object. Is there a better way to do this?
>>
>

Reply via email to