title: NLog Structured Logging Ignore Property By Name
body: <p>So I am using NLog and the JSON Layout Target to log my .Net Application and its data which is so far working mostly fine.</p>
  <p>However I have an issue where some of my objects contain Byte Arrays of large FileData that get included in the log file output which for file size reasons I don't want to include.</p>
  <p>Looking at the NLOG tutorials available there is an &quot;excludeProperties&quot; attribute that I can include in the Layout Configuration however I can't seem to get this to actually work specifically.</p>
  <p>So If my Object looks like,</p>
  <pre><code> public class Station : IStation
          {
         
              public int ID { get; set; }
              public string Name { get; set; }
              public string MACAddress { get; set; }
              public string ComputerName { get; set; }
      }
  </code></pre>
  <p>and I use the following Layout Config in NLog,</p>
  <pre><code> &lt;layout type='JsonLayout'&gt;
                  &lt;attribute name='Time' layout='${longdate}' /&gt;
                  &lt;attribute name='Level' layout='${level:upperCase=true}'/&gt;
                  &lt;attribute name='Call Site' layout='${callsite}'/&gt;
  
                  &lt;attribute name='Data' encode='false' &gt;
                      &lt;layout type='JsonLayout'
                              includeAllProperties=&quot;true&quot;
                              maxRecursionLimit=&quot;20&quot; 
                              excludeProperties=&quot;Name&quot;
                          &gt;
                          &lt;attribute name='message' layout='${message}' encode='false' /&gt;
                          &lt;attribute name='exception' layout='${exception}' /&gt;
                      &lt;/layout&gt;
                  &lt;/attribute&gt;
              &lt;/layout&gt;
  </code></pre>
  <p>Then use the structured logging call of:</p>
  <pre><code> _logger.Debug(&quot;Station Details:{@0}&quot;, Station);
  
    
  </code></pre>
  <p>The NLog output still includes the Name attribute in the produced log. In this example its just the name property however other objects include large file data being brought down from a DB and I would like to exclude those specific properties...</p>
  <p>So how do I specifically target the Name Property of the Station Object remembering that the &quot;Name&quot; Property will exists in other objects.</p>
  <p>I've tried the following Attributes and they all still include the Name property in the output.</p>
  <pre><code> excludeProperties=&quot;_Name&quot;
      excludeProperties=&quot;Name&quot;
      excludeProperties=&quot;Station_Name&quot;
      excludeProperties=&quot;IStation_Name&quot;
  </code></pre>
  <p>What is the correct &quot;Syntax&quot; for ignoring properties when using structured logging in NLog?</p>