Serilog.Events.LogEvent.LogEvent C# (CSharp) Method

LogEvent() public method

Construct a new LogEvent.
public LogEvent ( DateTimeOffset timestamp, LogEventLevel level, Exception exception, Serilog.Events.MessageTemplate messageTemplate, IEnumerable properties ) : System
timestamp DateTimeOffset The time at which the event occurred.
level LogEventLevel The level of the event.
exception System.Exception An exception associated with the event, or null.
messageTemplate Serilog.Events.MessageTemplate The message template describing the event.
properties IEnumerable Properties associated with the event, including those presented in .
return System
        public LogEvent(DateTimeOffset timestamp, LogEventLevel level, Exception exception, MessageTemplate messageTemplate, IEnumerable<LogEventProperty> properties)
        {
            if (messageTemplate == null) throw new ArgumentNullException(nameof(messageTemplate));
            if (properties == null) throw new ArgumentNullException(nameof(properties));
            Timestamp = timestamp;
            Level = level;
            Exception = exception;
            MessageTemplate = messageTemplate;
            _properties = new Dictionary<string, LogEventPropertyValue>();
            foreach (var p in properties)
                AddOrUpdateProperty(p);
        }