title: How to reduce output from Exception Data property with NLog JsonLayout?
body: <p>Right now using NLog JsonLayout to serialize the exception details like this:</p>
  <pre><code>&lt;target&gt;
    &lt;layout xsi:type=&quot;JsonLayout&quot;&gt;
      &lt;attribute name=&quot;Exception&quot; encode=&quot;false&quot; layout=&quot;${exception:format=@}&quot;/&gt;
  </code></pre>
  <p>The exception &quot;Data&quot; property contains some huge byte arrays, that I want to have truncated.</p>
  <p>Have tried using <code>${exception:format=@:truncate=500}</code>, but the output is then being cut so the format gets destroyed.</p>
  <p>How can I limit the output, while Json format remains valid?</p>
  <pre><code>{
  &quot;Date&quot;: &quot;2021-11-23T09:56:30.3214775Z&quot;,
  &quot;Application&quot;: &quot;MyApp&quot;,
  &quot;Logger&quot;: &quot;MyLogger&quot;,
  &quot;Level&quot;: &quot;ERROR&quot;,
  &quot;Exception&quot;: {
      &quot;Type&quot;: &quot;Microsoft.EntityFrameworkCore.DbUpdateException&quot;,
      &quot;Entries&quot;: [
          {
              &quot;Entity&quot;: {
                  &quot;Id&quot;: 0,
                  &quot;SomeStuff&quot;: {
                      &quot;Id&quot;: 0,
                      &quot;File&quot;: [
                          {
                              &quot;Name&quot;: &quot;myfile.pdf&quot;,
                              &quot;Data&quot;: [
                                  37,
                                  80,
                                  68,
                                  7
  </code></pre>