title: How to log exception stack trace in Json object with out breaking with log4j2
body: <p><strong>Environment</strong></p>
  
  <p>I have implemented <code>log4j</code> in my application successfully. I have used following pattern loayout:</p>
  
  <pre><code>{"a":"%X{Id}","b":"%d","message":"%m","priority":"%p","Exception":"%ex"}
  </code></pre>
  
  <p>It is logging as json format with my custom attributes.</p>
  
  <p>But while logging exception with %ex it is printing whole trace, i want it but it is breaking json format. </p>
  
  <p><strong>Question</strong></p>
  
  <p>So can you please suggest me to put whole stack trace in json without breaking.</p>