title: How to enable logging for gRPC in .NET Core 3.0
body: <p>I have an ASP.NET Core 3.0 (3.0.0-preview8-28405-07) server application which is using gRPC (0.1.22) with protocol buffers. I'd like to enable logging to a file or console.</p>
  
  <p>Below is an example of a .Startup file:</p>
  
  <pre><code>public class Startup
  {
      public void ConfigureServices(IServiceCollection services)
      {
          services.AddGrpc(options =&gt;
          {
              options.EnableDetailedErrors = true;
          });
      }
  
      public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
  
          app.UseRouting();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapGrpcService&lt;GreeterService&gt;();
          });
      }
  }
  </code></pre>
  
  <p>And the GreeterService:</p>
  
  <pre><code>public class GreeterService : Greeter.GreeterBase
  {
      public override Task&lt;HelloReply&gt; SayHello(HelloRequest request, ServerCallContext context)
      {
          return Task.FromResult(new HelloReply
          {
              Message = "Hello " + request.Name
          });
      }
  }
  </code></pre>
  
  <p>gRPC has a logging class called Grpc.Core.Logging.ILogger. How can I set this up so it is logging to a file or console?</p>