You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Purcell <sp...@vertisinc.com> on 2006/03/27 17:10:53 UTC

Tomcat Valve, how to Create Pattern

Tomcat 5.5
OS=Win2000

I would like to change the pattern for a valve in my server.xml. The API
shows when you have the element <pattern for the AccessLogValve that you
give it a name.

So where can I define a pattern for my needs, give it a name, then use
it?

Does anyone have an example of that?

Thanks,
Scott




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


Re: Tomcat Valve, how to Create Pattern

Posted by Jon Wingfield <jo...@mkodo.com>.
I may be wrong but I think there are only two predefined names: "common" 
and "combined". For all others you set the pattern attribute to the 
required number and ordering of pattern elements as defined in the docs. 
 From the docs:
The shorthand pattern name common (which is also the default) 
corresponds to %h %l %u %t "%r" %s %b

So, for example, if all you wanted was the url, the time it took to 
serve and the user agent you would set the pattern to:
%U %D "%{User-Agent}i"

The latter pattern element I got from the javadoc:
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/index.html

Jon

Scott Purcell wrote:
> Tomcat 5.5
> OS=Win2000
> 
> I would like to change the pattern for a valve in my server.xml. The API
> shows when you have the element <pattern for the AccessLogValve that you
> give it a name.
> 
> So where can I define a pattern for my needs, give it a name, then use
> it?
> 
> Does anyone have an example of that?
> 
> Thanks,
> Scott
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 



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