Discussion:
Problem with adding double quotes in a conversion pattern for PatternLayout specified in an XML configuration
Noel Sebastien (BIL)
2003-11-21 15:47:04 UTC
Permalink
Hi everyone,

I have a problem with adding double quotes in a conversion pattern for PatternLayout specified in an XML configuration.

Let's see the XML configuration fragment :

<appender name="AuditActivityFileAppender" class="org.apache.log4j.FileAppender">
<param name="File" value="${ginko.rootdir.as.file}/logs/audit_activity.log" />
<param name="Append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601}%m%n"/>
</layout>
</appender>

I would like to surround the date generated by %d{ISO8601} with double quotes like %d{ISO8601}, in order to output "01:15:23" instead of the plain 0115:23 ... BUT XML delimiter is this double quote !
Thus a XML parsing error occurs !! How can I do ? Do you have any escape sequence for the special character ", such as %q (like Quote) ?
I can't find any solution.
Thank you in advance ...

Sébastien



---------------------
An electronic message is not binding on its sender.
Any message referring to a binding engagement must be confirmed in writing and duly signed.
---------------------
Jacob Kjome
2003-11-22 05:20:15 UTC
Permalink
Have you tried &quot;

Jake

At 04:47 PM 11/21/2003 +0100, you wrote:
>Hi everyone,
>
>I have a problem with adding double quotes in a conversion pattern for
>PatternLayout specified in an XML configuration.
>
>Let's see the XML configuration fragment :
>
> <appender name="AuditActivityFileAppender"
> class="org.apache.log4j.FileAppender">
> <param
> name="File" value="${ginko.rootdir.as.file}/logs/audit_activity.log" />
> <param name="Append" value="true" />
> <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern"
> value="%d{ISO8601}%m%n"/>
> </layout>
> </appender>
>
>I would like to surround the date generated by %d{ISO8601} with double
>quotes like %d{ISO8601}, in order to output "01:15:23" instead of the
>plain 0115:23 ... BUT XML delimiter is this double quote !
>Thus a XML parsing error occurs !! How can I do ? Do you have any escape
>sequence for the special character ", such as %q (like Quote) ?
>I can't find any solution.
>Thank you in advance ...
>
>Sébastien
>
>
>
>---------------------
>An electronic message is not binding on its sender.
>Any message referring to a binding engagement must be confirmed in writing
>and duly signed.
>---------------------
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-***@jakarta.apache.org
>For additional commands, e-mail: log4j-user-***@jakarta.apache.org
Loading...