title: How to create logfile for each API using Serilog in .Net Framework?
body: <p>I have created .Net Web API project using 4.6.2 Framework. I am using Serilog within my application. As of now its a Static Class as below.</p>
  <pre><code>public static class Logger
  {
      private static readonly ILogger _logger;
  
      static A1Logger()
      {
          _logger = new LoggerConfiguration()
              .WriteTo.File((&quot;C:/logs/log-.txt&quot;), rollingInterval: RollingInterval.Day)
              .CreateLogger();
      }
  
      public static void LogError(string error)
      {
          //_logger.ToJSON(error);
          _logger.Error(error);
      }
  
      public static void LogInformation(string info)
      {
          _logger.Information(info);
      }
  }
  </code></pre>
  <p>It creates log file and also logs information. However I want to create Logfile for each API.</p>
  <p>For example If I Hit http://localhost:52137/Controller/sessions It should create Sessions Logfile and should log inside that file and If I hit http://localhost:52137/Controller/Event API it should create Event Logfile and start logging inside it.</p>
  <p>RollingInterval should be as above in my Static class. I checked a lot on google there are lot of example for .NetCore fir Serilogs but I couldn't see anything much on .NET Framework. I think I have to use Filter as per my research however I am not sure how can I configure it in .Net Framework. Also, I think Static class wont help me to create multiple log files. Also logfile operation should be asynchronous.</p>
  <p>Thank you in advance for your help and If you need some more information about please let me know.</p>