示例#1
0
            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,
                });
            }
示例#2
0
 public IDisposable BeginScope <TState>(TState state) => _provider.PushScope(ScopeUtility.GetStructuredData(state));