/// <summary> /// 构造日志事件对象 /// </summary> /// <param name="LogCode">日志代码</param> /// <param name="Message">日志信息</param> /// <param name="ModuleName">模块名称</param> /// <param name="Properties">特殊属性</param> public LoggingEvent(string LogCode, string Message, string ModuleName, Dictionary <string, string> Properties) { m_data = new LoggingData(); m_data.Message = Message; m_data.Module = ModuleName; m_data.LogCode = LogCode; m_data.Properties = Properties; m_data.TimeStamp = DateTime.Now; }
/// <summary> /// Initializes a new instance of the <see cref="LoggingEvent"/> class. /// </summary> /// <param name="message">The message.</param> /// <param name="ex">The ex.</param> /// <param name="ModuleName">Name of the module.</param> /// <param name="Properties">The properties.</param> public LoggingEvent(string message, Exception ex, string ModuleName, Dictionary <string, string> Properties) { m_data = new LoggingData(); m_data.Message = message; m_data.Module = ModuleName; m_data.LogCode = "00001"; m_data.Properties = Properties; m_data.StackTrace = ex.StackTrace; if (ex.InnerException != null) { m_data.StackTrace += Environment.NewLine + "InnerException:" + ex.InnerException.Message + Environment.NewLine + "Trace:" + ex.InnerException.StackTrace; } m_data.TimeStamp = DateTime.Now; }