title: Retrieve identity inside a ILogger custom implementation
body: <p>I am implementing a custom Microsoft.Extensions.Logging.ILogger (and ILoggerProvider. I would like to retrieve the current identity but I really don't how since I cannot inject anything, and I also don't know the current HttpContext.</p>
  
  <p>My approach may be wrong... Is there a typical solution for this kind of requirement?</p>
  
  <p>here are some few lines of code:</p>
  
  <pre><code>factory.AddProvider(new MongoDBLoggerProvider(connectionString, database));
  </code></pre>
  
  <p>in the provider:</p>
  
  <pre><code>public ILogger CreateLogger(string categoryName)
  {
      var client = new MongoClient(_connectionString);
      var database = client.GetDatabase(_database);
  
      return new MongoDBLogger(database, categoryName);
  }
  </code></pre>
  
  <p>In the logger:</p>
  
  <pre><code>public void Log&lt;TState&gt;(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func&lt;TState, Exception, string&gt; formatter)
  {
      var now = DateTime.Now;
      var entry = new LogEntry
      {
          Date = now,
          UserId = ?????
          Exception = exception,
          Level = logLevel,
          State = state.ToString(),
          Scope = _categoryName,
          EventId = eventId.Id,
          EventName = eventId.Name,
          FormattedState = formatter != null ? formatter(state, exception) : null
      };
  
      PushAndForget(entry, _database);
  }
  </code></pre>