title: Disable ColoredConsole Logging provider from Azure Functions V2
body: <p>I am using Serilog for structured logging in asp.net core and would like to use the same library with Azure Functions. </p>
  
  <p>My goal is to write the log messages in JSON format to Console Sink through Serilog. It is working, but the Functions Framework is also writing the text based logs using ColoredConsole provider. I want to disable that.</p>
  
  <p>As you can see from the following code I tried to replace the LoggerFactory and clearing the providers. It still didn't work.</p>
  
  <pre><code>[assembly: WebJobsStartup(typeof(FuncStartup))]
  namespace Function.Test
  {
      public class FuncStartup : IWebJobsStartup
      {
          public void Configure(IWebJobsBuilder builder)
          {
  
              var loggerConfiguration = new LoggerConfiguration()
                  .Enrich.FromLogContext()
                  .Enrich.WithExceptionDetails()
                  .Enrich.WithEnvironmentUserName()
                  .Enrich.WithMachineName()
                  .Enrich.WithProcessId()
                  .Enrich.WithProcessName()
                  .Enrich.WithThreadId()
                  .Enrich.With&lt;ServiceVersionEnricher&gt;()
                  .WriteTo.Console(new JsonFormatter());
  
              Log.Logger = loggerConfiguration.CreateLogger();
  
              //return serviceCollection.Replace(new ServiceDescriptor(typeof(ILoggerFactory), s =&gt; new SerilogLoggerFactory(null, true), ServiceLifetime.Singleton));
  
              builder.Services.AddLogging(b =&gt;
              {
                  b.ClearProviders();
                  b.AddSerilog(Log.Logger);
              });
          }
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p><a href="https://i.stack.imgur.com/CLBFG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CLBFG.png" alt="enter image description here"></a></p>