title: Serilog not logging as expected when using TextWriter
body: <p>I am trying to figure out how to get Serilog to log the class name and method/line number, like I would see with log4cxx in C++.</p>
  
  <p>I tried my best to grab all the relevant bits out of the real code I am working on and come up with a minimal example.</p>
  
  <p>I've also been Googling Serilog left and right, but I am not finding good documentation. I suppose it is because there are so many libraries on top of the base serilog and each needs there own docs to tell me how to do things.</p>
  
  <p>I can see the basics on configuration at <a href="https://github.com/serilog/serilog/wiki/Configuration-Basics" rel="nofollow noreferrer">https://github.com/serilog/serilog/wiki/Configuration-Basics</a> , but this seems to use a TextWriter sink from a seperate Serilog library and a custom formatter, both of which I don't really understand.</p>
  
  <p>I can also find examples on stack overflow that use the simple configuatation and the enrich call to log the class and method names.</p>
  
  <p><a href="https://stackoverflow.com/questions/47576733/c-sharp-asp-net-core-serilog-add-class-name-and-method-to-log?rq=1">C# ASP.NET Core Serilog add class name and method to log</a></p>
  
  <p>I am not able to get it to log them. How can I get this to log the class and method name or line number while still using the custom formatter and TextWriter?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  using Serilog;
  using Serilog.Events;
  using Serilog.Formatting;
  
  namespace SerilogDemo {
  
      // Someone else made this, I just changed the name to protect the innocent
      public class SomeonesLogTextFormatter : ITextFormatter
      {
          public void Format(LogEvent logEvent, TextWriter output)
          {
              output.Write(logEvent.Level);
              output.Write(": ");
              logEvent.MessageTemplate.Render(logEvent.Properties, output);
              output.WriteLine();
  
              if (logEvent.Exception != null)
              {
                  output.WriteLine(logEvent.Exception);
              }
          }
      }
  
      public class SomeClass
      {
          private Serilog.ILogger _log = Serilog.Log.ForContext&lt;SomeClass&gt;();
  
          public SomeClass()
          {
              _log.Debug("SomeClass has been instantiated");
          }
  
          public void Foo()
          {
              _log.Debug("Foo has been called");
          }
      }
  
      class Program
      {
          static void Main(string[] args)
          {
  
              Log.Logger = new LoggerConfiguration()
                  .MinimumLevel.Debug()
                  .Enrich.FromLogContext()
                  .WriteTo.TextWriter(textWriter: Console.Out, formatter: new SomeonesLogTextFormatter())
                  .CreateLogger();
  
              var poop = new SomeClass();
              poop.Foo();
          }
      }
  }
  </code></pre>