title: Exclude specific endpoint serilog logging using aspnet core
body: <p>We have an aspnetcore application and we have a healthcheck that makes request to an endpoint every x seconds. Our API is using serilog, logging level information which log each request made to the API.</p>
  
  <p>My question is: How can we filter to exclude from log requests made to a specific endpoint?</p>
  
  <p>Just for example this is our logging code today:</p>
  
  <pre><code>        WebHost.CreateDefaultBuilder(args)
              .UseStartup&lt;Startup&gt;()
              .UseSerilog((hostingContext, loggerConfiguration) =&gt; loggerConfiguration
                  .Enrich.FromLogContext()                    
                  .Filter.ByExcluding(c =&gt; c.MessageTemplate.Text.Contains("Request"))
                  .WriteTo.Console()
                  .WriteTo.RollingFile(hostingContext.Configuration["log-path"]))                    
              .Build();
  </code></pre>
  
  <p>Today we can only filter all requests. How do we filter a specific endpoint request?</p>