public void Log <TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func <TState, Exception, string> formatter) { var scopeData = _provider.CurrentScopeData; scopeData = scopeData.SetItems(ScopeUtility.GetStructuredData(state)); _provider.AddMessage(new LogMessage { CategoryName = _categoryName, LogLevel = logLevel, EventId = eventId, Exception = exception, Message = formatter(state, exception), ScopeValues = scopeData, }); }
public IDisposable BeginScope <TState>(TState state) => _provider.PushScope(ScopeUtility.GetStructuredData(state));