2014-07-22 2:43 GMT+04:00 Dames, Kristopher J <kristopher.da...@mercy.net>:
> Can anyone point me to an example of conditional logging in Tomcat 6? Here is 
> what I have tried to no avail. I want requests that match /*/iaahb to not be 
> logged.
>
> In my server.xml:
>
> <Valve className="org.apache.catalina.valves.AccessLogValve"
>     condition="DoNotLog"
>     directory="logs"
>     fileDateFormat="yyyy-MM-dd"
>     pattern="%{X-Forwarded-For}i %h %l %u %t &quot;%r&quot; %s %b 
> &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot;"
>
>     prefix="access_log"/>
>
> in my web.xml:
>
>     <!-- Custom filter to prevent logging health check requests -->
>     <filter>
>         <filter-name>Set Do Not Log Attribute</filter-name>
>         <filter-class>SetDoNotLogFilter</filter-class>
>         <init-param>
>             <param-name>DoNotLog</param-name>
>             <param-value>true</param-value>
>         </init-param>
>     </filter>
>     <filter-mapping>
>         <filter-name>Set Do Not Log Attribute</filter-name>
>         <url-pattern>/*/iaahb</url-pattern>

The url-pattern syntax defined by the Servlet specification is
somewhat limited. The "*" has special meaning in two constructs only:
a) when defining prefix mapping, as "/*" at the end, e.g. /foo/*
b) when defining extension mapping, .e.g. *.foo

In all other situations the "*" character is interpreted literally as
a character, with no special meaning.

>     </filter-mapping>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to