예제 #1
0
 /// <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.
     }
 }
예제 #2
0
        /// <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.
            }
        }