title: Hangfire does not log exception using configured Logger
body: <p>As per the <a href="http://docs.hangfire.io/en/latest/configuration/configuring-logging.html" rel="nofollow noreferrer">hangfire documentation</a> </p>
  
  <blockquote>
    <p>Starting from Hangfire 1.3.0, you are not required to do anything, if
    your application already uses one of the following libraries through
    the reflection (so that Hangfire itself does not depend on any of
    them). Logging implementation is automatically chosen by checking for
    the presence of corresponding types in the order shown below.</p>
    
    <p>Serilog<br>
    NLog<br>
    Log4Net<br>
    EntLib<br>
    Logging<br>
    Loupe<br>
    Elmah  </p>
  </blockquote>
  
  <p>I have ASP.NET Core 2.0 application that is using <code>Serilog</code> like below</p>
  
  <pre><code>public class Program
  {
      public static void Main(string[] args)
      {
          BuildWebHost(args).Run();
      }
  
      public static IWebHost BuildWebHost(string[] args) =&gt;
          WebHost.CreateDefaultBuilder(args)
          .UseStartup&lt;Startup&gt;()
          .UseApplicationInsights()
          .UseUrls("http://*:40006")
          .ConfigureAppConfiguration((hostingContext, config) =&gt;
          {
             // removed for bravity
          })
          .ConfigureLogging((hostingContext, logging) =&gt;
          {                
                  Log.Logger = new LoggerConfiguration()
                  .ReadFrom.Configuration(hostingContext.Configuration)
                  .CreateLogger();
  
                  logging.AddSerilog();
  
          })
          .Build();
  }
  </code></pre>
  
  <p>The application is configured to use Hangfire. During background job processing if there is any exception occurs, Hangfire re-tries the job 10 times with increasing delay as expected, and it shows the exceptions in dashboard.</p>
  
  <p><strong>Issue</strong><br>
  The Hangfire dashboard shows the exception on UI however it does not log the exception into configured Serilog sink.</p>
  
  <p>Note: The Hangfire dashboard shows exception but it formats the exception  <a href="https://stackoverflow.com/questions/49245955/hanfire-not-logging-custom-exception-with-metadata">see here</a> which hides critical information about the exception.
  I think if it logs the exception, Serilog logger would log the complete exception.</p>