示例#1
0
 public GelfMessageBuilder(string message, string host, DateTime timestamp, GelfLevel level)
 {
     this.message = message;
     this.host = host;
     this.timestamp = timestamp;
     this.level = level;
 }
示例#2
0
 public GelfMessageBuilder(string message, string host, DateTime timestamp, GelfLevel level)
 {
     this.message   = message;
     this.host      = host;
     this.timestamp = timestamp;
     this.level     = level;
 }
示例#3
0
 public GelfMessageBuilder(string message, string host, DateTime timestamp, GelfLevel level)
 {
     _message   = message;
     _host      = host;
     _timestamp = timestamp;
     _level     = level;
 }
示例#4
0
 public GelfMessageBuilder SetLevel(GelfLevel value)
 {
     level = value;
     return(this);
 }
示例#5
0
        protected GelfMessageBuilder CreateGelfMessageBuilder(string message, DateTime timeStamp, GelfLevel logLevel)
        {
            var messageBuilder = new GelfMessageBuilder(message, Environment.MachineName.ToUpperInvariant(), timeStamp, logLevel);

            if (_config.AdditionalProperties == null)
            {
                return(messageBuilder);
            }
            foreach (var kvp in _config.AdditionalProperties)
            {
                messageBuilder.SetAdditionalField($"{_config.PropertyPrefix}{kvp.Key}", kvp.Value);
            }
            return(messageBuilder);
        }