예제 #1
0
		public LogMessage(log4net.Core.LoggingEvent logEvent)
		{
			LoggerName = logEvent.LoggerName;

			ThreadName = logEvent.ThreadName;
			Message = logEvent.RenderedMessage;
			TimeStamp = logEvent.TimeStamp;
			Level = LogUtils.GetLogLevelInfo(logEvent.Level.Value);

			// Per LoggingEvent.ExceptionObject, the exception object is not serialized, but the exception 
			// text is available through LoggingEvent.GetExceptionString
			ExceptionString = logEvent.GetExceptionString();

			// Copy properties as string
			foreach (DictionaryEntry entry in logEvent.Properties)
			{
				if (entry.Value == null)
					continue;

				Properties.Add(entry.Key.ToString(), entry.Value.ToString());
			}
		}