title: Log response without sensitive data in .NET 5.0
body: <p>I want to log (with ex Serilog) the response AND request from every endpoint in a .NET 5-API leaving out or sensoring data marked as sensitive. So far I tried to implement it with attributes in the data-class and logging from either filters or a middleware, but I haven't found a way to read property attributes. Does anyone have an example of how to do it?</p>
  <pre><code>public class Document {
      public int Id { get; set; }
      [SensitiveData]
      public string NationalId { get; set; }
      public byte[] Data { get; set; }
  }
  
  public class SensitiveDataAttribute : Attribute { } 
  </code></pre>