title: Serilog logger configuration by SourceContext
body: <p>I am trying to implement serilog in a little sample-project. I´ve did the following so far:</p>
  
  <ul>
  <li>Create new ASP.NET Core Web Application (MVC)</li>
  <li>Install-Package Serilog.AspNetCore </li>
  <li>Install-Package Serilog.Sinks.File</li>
  <li>Install-Package Serilog.Formatting.Compact</li>
  <li>Follow <a href="https://nblumhardt.com/2017/08/use-serilog/" rel="nofollow noreferrer">this</a> blogpost</li>
  <li>Try to follow <a href="https://nblumhardt.com/2016/11/ilogger-beginscope/" rel="nofollow noreferrer">this</a> blogpost</li>
  </ul>
  
  <p>My question:</p>
  
  <p>Is there a possibility to configure two different loggers, based on CategoryName (in my case "MyLogger")? I want this logger to use a different file, than my default-logger. In my happy-world-fantasy it would look like: </p>
  
  <pre><code>        Log.Logger = new LoggerConfiguration()
              .MinimumLevel.Debug()
              .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
              .Enrich.FromLogContext()
              .WriteTo.File(new CompactJsonFormatter(), @"C:\temp\standardLog.txt")
              .WriteTo.File(new CompactJsonFormatter(), @"C:\temp\specialLog.txt").Filter.ByIncludingOnly(x =&gt; x.SourceContext("MySpecialLogger")
              .CreateLogger();
  </code></pre>
  
  <p>And if I create a new Logger <code>var logger = _loggerFactory.CreateLogger("MySpecialLogger");</code> the logs will be safed in my specialLog.txt-file.</p>
  
  <p>Any ideas?  </p>