title: NLog config - including JSON attribute based on condition
body: <p>I have an attribute that I want to include only if LogLevel is at least 'Error'. I know that I need to write this:</p>
  <pre><code>Layout=&quot;${when=level&gt;=LogLevel.Error}&quot;
  </code></pre>
  <p>but the attribute has inner Json Layout so it ignores my condition. I assume I don't realize how to implement the condition.
  That's what I have now, which doesn't work:</p>
  <pre><code>&lt;attribute name=&quot;error&quot; encode=&quot;false&quot; Layout=&quot;${when=level&gt;=LogLevel.Error}&quot;&gt;
      &lt;layout type=&quot;JsonLayout&quot;&gt;
          &lt;attribute name=&quot;message&quot; layout=&quot;${message}&quot; /&gt;
      &lt;/layout&gt;
  &lt;/attribute&gt;
  </code></pre>