/// <inheritdoc /> public void Log(string message, LogLevel?logLevel = null) { try { var logStatement = new LogStatement(DateTimeOffset.UtcNow, logLevel ?? LogLevel.Information, message); _logStatementDispatcher.Dispatch(logStatement); } catch (Exception) { // Send email etc. } }
/// <inheritdoc /> public void Log(string message, LogLevel?logLevel = null) { try { var logStatementProperties = new List <ILogStatementProperty>(); foreach (var logStatementEnricher in _logStatementEnrichers) { logStatementProperties.Add(logStatementEnricher.Enrich()); } var logStatement = new LogStatement(DateTimeOffset.UtcNow, logLevel ?? LogLevel.Information, message, logStatementProperties); _logStatementDispatcher.Dispatch(logStatement); } catch (Exception) { // Send email etc. } }