You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Mast <jh...@gmail.com> on 2008/09/10 23:00:32 UTC

specifying a custom access log pattern

Hi, I was wondering what the exact syntax for specifying a custom access log
pattern in the server.xml is.

Here is a snippet from which contains my custom format:

                <Valve className="org.apache.catalina.valves.AccessLogValue"
                    prefix="foo."
                    suffix=".accesslog"
                    directory="/usr/local/tomcat/logs/context_logs/"
                    pattern="%h %t %m "%U" %H %s %b "%{User-Agent}i"
"%{Referer}i" %D %I" />


my question is: how should a I handle the nested double quotes in the
pattern attribute?  How should i escape them?

I presume as-is, this will cause Tomcat quite some trouble.

thanks,
Tomcat 5.5

Re: specifying a custom access log pattern

Posted by Konstantin Kolinko <kn...@gmail.com>.
> my question is: how should a I handle the nested double quotes in the
> pattern attribute?  How should i escape them?

&quot; or &#34;

See "4.6 Predefined Entities" in XML Spec for details,
http://www.w3.org/TR/2006/REC-xml-20060816/#sec-predefined-ent


2008/9/11 Jonathan Mast <jh...@gmail.com>:
> Hi, I was wondering what the exact syntax for specifying a custom access log
> pattern in the server.xml is.
>
> Here is a snippet from which contains my custom format:
>
>                <Valve className="org.apache.catalina.valves.AccessLogValue"
>                    prefix="foo."
>                    suffix=".accesslog"
>                    directory="/usr/local/tomcat/logs/context_logs/"
>                    pattern="%h %t %m "%U" %H %s %b "%{User-Agent}i"
> "%{Referer}i" %D %I" />
>
>
> my question is: how should a I handle the nested double quotes in the
> pattern attribute?  How should i escape them?
>
> I presume as-is, this will cause Tomcat quite some trouble.
>
> thanks,
> Tomcat 5.5
>

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