title: Implicit scopes for ILogger
body: <p>I am using <code>ConsoleLoggerProvider</code> from Microsoft.Extensions.Logging (MEL) to write logs in .NET 6 console application.</p>
  <p>I want my logs to include &quot;class&quot; and &quot;method&quot; records for each log entry, to know &quot;from where&quot; in my code the log message was written.</p>
  <p>The only current way to do it without using third-party logging solutions like Serilog, is to use a built-in feature of &quot;log scopes&quot; in MEL.</p>
  <p>So I end up writing code like:</p>
  <pre><code>public class MyClass {
  
      ILogger _logger;
  
      .... //Contructor, etc.
  
      public void MyMethod() 
      {
          using (_logger.BeginScope($&quot;{nameof(MyClass)} =&gt; {nameof(MyMethod)}&quot;))
              {
                  ...//actual logic is here
              }
       }
  }
      
  </code></pre>
  <p>I observe a concept of &quot;ExternalScopeProviders&quot; in the MS documentation but it's completely undocumented and example-free. Is there are more &quot;implicit&quot; way of having the code-structure scopes set automatically? Or are we (as .NET 6/C# users) are bound to explicit use of <code>using (_logger.BeginScope)</code> in our code to achieve this?</p>