Пример #1
0
        public void WriteEntry(string msg, NeatLogLevel level, int eventId, ushort taskCategory, string eventSource)
        {
            ILoggerRepository repository   = log4NetLog.Logger.Repository;
            string            loggerName   = log4NetLog.Logger.Name;
            Level             log4netLevel = new Level((int)level, level.ToString());
            LoggingEvent      loggingEntry = new LoggingEvent(loggingType, repository, loggerName, log4netLevel, msg, null);

            loggingEntry.Properties["EventID"]      = eventId;
            loggingEntry.Properties["TaskCategory"] = taskCategory;
            loggingEntry.Properties["EventSource"]  = eventSource;
            log4NetLog.Logger.Log(loggingEntry);
        }
Пример #2
0
        public void Log(NeatLogLevel loglevel, string formatStr, params object[] args)
        {
            try
            {
                if (CurrentLogLevel > loglevel)
                {
                    return;
                }

                string finalMsg = GetFinalMessage(formatStr, args);
                WriteEntry(finalMsg, loglevel, 0, 0, string.Empty);
            }
            catch (Exception e)
            {
                string skipFxCop = e.Message;
            }
        }
Пример #3
0
 private void WriteEntry(string msg, NeatLogLevel level, int eventId, ushort taskCategory, string eventSource)
 {
     loggerImp.WriteEntry(msg, level, eventId, taskCategory, eventSource);
 }