title: Serilog written to the ILogger does not appear (Azure Functions V2)
body: <p>I've installed Serilog and configured to write the log event data to a table in MS SQL Server for Azure Function.</p>
  
  <p>System logs and logs that have been written by the static class itself appears on the table but when I try to use Extensions.Logging.ILogger, messages are not appear in the table even if I can see the Serilog provider in the ILogger.</p>
  
  <p><strong>Startup.cs configuration;</strong></p>
  
  <pre class="lang-cs prettyprint-override"><code>using Microsoft.ApplicationInsights.Extensibility;
  using Microsoft.Azure.WebJobs.Hosting;
  using Serilog;
  using Serilog.Events;
  using Serilog.Sinks.MSSqlServer;
  using Microsoft.Azure.WebJobs;
  
  [assembly: FunctionsStartup(typeof(Rubix.FunctionApp.Startup))]
  namespace Rubix.FunctionApp
  {
      public class Startup : IWebJobsStartup
      {
  
          public Startup()
          {
              var config = new ConfigurationBuilder()
                 .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
                 .AddEnvironmentVariables()
                 .Build();
  
              var logDbConnectionString = "connectionString";
              var logTable = "LogEntry";
              var columnOptions = new ColumnOptions()
              {
                  AdditionalColumns = new Collection&lt;SqlColumn&gt;
                  {
                      new SqlColumn
                          {ColumnName = "Filter", DataType = SqlDbType.NVarChar, DataLength = 50},
  
                      new SqlColumn
                          {ColumnName = "JsonType", DataType = SqlDbType.NVarChar, DataLength = 50},
                  }
              };
              // we don't need XML data
              columnOptions.Store.Remove(StandardColumn.Properties);
              // we do want JSON data
              columnOptions.Store.Add(StandardColumn.LogEvent);
              // exclude standard columns from the json output
              columnOptions.LogEvent.ExcludeStandardColumns = true;
  
              Log.Logger = new LoggerConfiguration()
                  .ReadFrom.Configuration(config)
                  .Enrich.FromLogContext()
                  .WriteTo.MSSqlServer(
                      connectionString: logDbConnectionString,
                      tableName: logTable,
                      columnOptions: columnOptions
                  )
                  .WriteTo.ApplicationInsights(TelemetryConfiguration.Active, TelemetryConverter.Traces, LogEventLevel.Information)
                  .CreateLogger();
          }
  
  
  
          public void Configure(IWebJobsBuilder builder)
          {
              ConfigureServices(builder.Services).BuildServiceProvider(true);
          }
  
          private IServiceCollection ConfigureServices(IServiceCollection services)
          {
               services
                  .AddLogging(loggingBuilder =&gt;
                      loggingBuilder.AddSerilog(dispose: true)
                  );
  
              return services;
          }
  
      }
  }
  </code></pre>
  
  <p><strong>Creation of ILogger in Azure Function;</strong></p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Function
      {
          private readonly ILogger&lt;Function&gt; _logger;      
  
          public Function(ILoggerFactory loggerFactory)
          {
              _logger = loggerFactory.CreateLogger&lt;Function&gt;();
          }
  
          [FunctionName("Function1")]
          public async Task Run([ServiceBusTrigger("topic-name", "subscription-name", Connection = "AzureServiceBus")]string message)
          {
              Log.Logger.Information("Function invoked");// ----&gt;  WORKING!
  
              _logger.LogInformation("Function invoked by ILogger");// ----&gt; NOT WORKING!
  
          }
  
  
      } 
  </code></pre>
  
  <p>Also, receiving ILogger itself into cons is not working ..</p>
  
  <p><strong>Weird part is only system logs are being logged into table;</strong></p>
  
  <p><a href="https://i.stack.imgur.com/6v72r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6v72r.png" alt="enter image description here"></a></p>
  
  <p><strong>And Serilog provider is already exists in not working ILogger instance;</strong></p>
  
  <p><a href="https://i.stack.imgur.com/tPeFD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tPeFD.png" alt="enter image description here"></a></p>