<div dir="ltr"><p dir="ltr">Yes, logback does this well in fact. </p><p>I can show you and example of a logback encoder that encodes to a JSON format. You can extend the concept to encode XML just the same. Possibly you could use very similar code to mine and abstract your message formatting into a builder pattern.</p>
<p>For my money though, I'd stick with JSON. I'd also steer you toward Logstash and Kibana as a killer combo for dealing with logs--both of these tools are free and open source.</p><p>I attached some (incomplete WRT to dependencies) code that should get the main point across.</p>
<p>Good Luck.</p><p><br></p><p>Troy</p>
</div>