Issue Type: Bug Bug
Assignee: Logback dev list
Created: 13/Aug/14 6:37 PM
Description:

The syntax for patterns accepted by [`PatternLayoutEncoder`](http://logback.qos.ch/apidocs/ch/qos/logback/classic/encoder/PatternLayoutEncoder.html) is partially specified in [the "layouts documentation](http://logback.qos.ch/manual/layouts.html), where it says

> In PatternLayout, parenthesis can be used to group conversion patterns. It follows that the '(' and ')' carry special meaning and need to be escaped if intended to be used as literals.

> ...

> % character has special meaning ... in order to include it as a literal, it needs to be escaped with a backslash, e.g. "%d %p % %m%n".

However, it says nothing about the characters `

{` and `}

`. I wish to write a pattern which will output a literal open brace character. To this end I have tried, in my `logback.xml`:

<encoder>
<pattern>{</pattern>
</encoder>

This causes Logback to fail with a `NullPointerException` when parsing the configuration file.

Then, by analogy with the escape character for the literal characters `%`, `(`, and `)`, I have tried:

<encoder>
<pattern>{</pattern>
</encoder>

This causes Logback to fail in the same way.

Presumably the `NullPointerException` is a bug in Logback. How do I work around it and output a literal brace character?

Project: logback
Priority: Major Major
Reporter: James Fisher
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
logback-dev mailing list
logback-dev@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-dev

Reply via email to