예제 #1
0
        private void LogSMTPError(string email, string message)
        {
            string        smtpError   = Localization.GetString("SMTPError", LocalResourceFile);
            string        smtpMessage = Localization.GetString("SMTPMessage", LocalResourceFile);
            LogProperties properties  = new LogProperties();

            properties.Add(new LogDetailInfo(smtpError, email));
            properties.Add(new LogDetailInfo(smtpMessage, message));
            AddEventLog(EventLogController.EventLogType.ADMIN_ALERT.ToString(), properties, true);
        }
예제 #2
0
        /// <inheritdoc />
        public virtual ILog <TCategoryName> Property(string propertyName, string propertyValue)
        {
            if (string.IsNullOrWhiteSpace(propertyName))
            {
                return(this);
            }
            if (LogProperties.ContainsKey(propertyName))
            {
                LogProperties[propertyName] += propertyValue;
                return(this);
            }

            LogProperties.Add(propertyName, propertyValue);
            return(this);
        }
예제 #3
0
        /// <summary>
        /// 将状态对象转换到日志内容字典中
        /// </summary>
        protected virtual void ConvertStateToContent()
        {
            if (LogState == null)
            {
                return;
            }
            var state = Conv.ToDictionary(LogState);

            foreach (var item in state)
            {
                if (item.Value.SafeString().IsEmpty())
                {
                    continue;
                }
                LogProperties.Add(item);
            }
        }