protected override void Prepare(LoggingData logging)
 {
     if (logging.Properties != null)
         logging.ApplicationName = logging.Properties["log4japp"];
 }
        public void Log(LoggingData loggingData)
        {
            var logEntry = new LogEntry();

            logEntry.Message = loggingData.Message;
            logEntry.AppDomainName = loggingData.Domain;
            logEntry.AddErrorMessage(loggingData.ExceptionString);
            logEntry.Categories = new string[] { loggingData.LoggerName };

            TraceEventType eventType;

            if (!s_EventTypeDict.TryGetValue(loggingData.Level, out eventType))
                eventType = TraceEventType.Information;

            logEntry.Severity = eventType;

            logEntry.ManagedThreadName = loggingData.ThreadName;
            logEntry.TimeStamp = loggingData.TimeStamp;

            m_LogWriter.Write(logEntry);
        }
示例#3
0
 /// <summary>
 /// Logs the specified logging data.
 /// </summary>
 /// <param name="loggingData">The logging data.</param>
 /// <exception cref="System.NotSupportedException"></exception>
 public void Log(LoggingData loggingData)
 {
     throw new NotSupportedException();
 }
示例#4
0
 /// <summary>
 /// Logs the specified logging data.
 /// </summary>
 /// <param name="loggingData">The logging data.</param>
 /// <exception cref="System.NotSupportedException"></exception>
 public void Log(LoggingData loggingData)
 {
     throw new NotSupportedException();
 }