I'm trying to output a pattern that contains the characters < > in the form
08:06:41 DEBUG 69 [ch.fhnw.edu.rental.model.Movie] - <Movie 'Cars' created>
Where <Movie 'Cars' created> is the log-message.
My PatternLayout is as follows:
<PatternLayout pattern="%d{HH:mm:ss} %-5p %L [%c] - <%m%n>"/>
Unfortunately this produces the error
[Fatal Error] log4j2.xml:5:65: The value of attribute "pattern" associated with an element type "PatternLayout" must not contain the '<' character.
How can I escape the < > characters without hardcoding them into the source code?