title: Sharing logger between different .NET frameworks
body: <p>I am creating an application framework that can be shared between .Net Core 1.2, .Net Core 2.0 and .NET Framework 4.6+. So I choose the target framework of my project as .NET Standard. In my framework project I have factory class that is used to send a text message or email. On application startup, each application configures the factory with the supported services as singleton instance with DI framework.  </p>
  
  <pre><code>public class MyFactory : IMyFactory
  {
        private ILogger _logger;
        private IDictionary&lt;string,IMyService&gt; _container = new Dictionary&lt;string,IMyService&gt;();
  
      // this method is called on application startup to configure supported services
      public void Configure(string[] keys, ILogger logger)
      {  
          foreach(var key in keys)
          {
               if(key == "text")
               {
                   container.Add(key,new TextMessageService());
               }   
  
               if(key == "email")
               {
                   container.Add(key,new EmailService());
               }
          }
      }
  
      //application call this method to send message
      public bool SendMessage(string key, string message)
      {
           // we don't want application to stop when publish fail, so we add try-catch and log the message
           var flag = false;
  
           try
           {
               var service= container[key];
               service.Publish(message);
               flag = true;
           }
           class(Exception ex)
           {
              _logger.Error(ex);
           }
  
           return flag;
      }
  }
  </code></pre>
  
  <p><strong>Issue</strong>: the publish method could fail for any reason. And in such case I don't want application to stop, instead the framework should log the error message. My problem is since the framework can be shared between different .NET frameworks, I don't know which type of <code>ILooger</code> I should be using that can be shared between .NET Core and .NET Full.</p>
  
  <p>I am trying to avoid creating my own <code>ILogger</code> interface. Also currently all applications are using <code>Serilog</code> but in future that could change.</p>
  
  <p>Can <code>Microsoft.Extensions.Logging</code> be used here?</p>