private bool SendTheMessageToRemoteHost(string logKey, string message) { MailUtil.SendEmail(new SendMail { Host = this.Host, UserName = this.UserName, Password = this.Password, FromMailAddress = this.From, DisplayName = this.DisplayName ?? this.UserName, Subject = string.Format("【{0}】{1}-{2}-告警", HostUtil.GetHostIp(), AppName, logKey), Body = message, IsBodyHtml = IsHtml, ToMailAddressList = To.Split(',').ToList() }); return(true); }
public ChunkBuilder() { this.chunk = new Chunk(); chunk.EnvGroup = Configuration.GetEnvironmentGroup(); chunk.Env = Configuration.GetEnvironment(); chunk.HostIp = HostUtil.GetHostIp(); chunk.HostName = HostUtil.GetHostName(); chunk.AppId = Configuration.GetAppId(); chunk.ProcessId = 0; List <LogEvent> logEventList = new List <LogEvent>(); List <Span> spanList = new List <Span>(); List <MetricEvent> metricList = new List <MetricEvent>(); List <Event> eventList = new List <Event>(); chunk.LogEvents = logEventList; chunk.Spans = spanList; chunk.Metrics = metricList; chunk.Events = eventList; }