当前位置: 首页>>代码示例>>C#>>正文


C# CLogger.SetLogLevel方法代码示例

本文整理汇总了C#中CLogger.SetLogLevel方法的典型用法代码示例。如果您正苦于以下问题:C# CLogger.SetLogLevel方法的具体用法?C# CLogger.SetLogLevel怎么用?C# CLogger.SetLogLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CLogger的用法示例。


在下文中一共展示了CLogger.SetLogLevel方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeLogger

 public static bool InitializeLogger()
 {
     try
     {
         L = new CLogger();
         L.SetLogLevel((LogLevel)((TraceLevel < 0 || TraceLevel > 4) ? 3 : TraceLevel));
         L.SetLogFile(@"C:\tmp\IISRecorderLog.log");
         L.SetTimerInterval(LogType.FILE, 0);
         L.SetLogFileSize(10000000);
         return true;
     }
     catch (Exception er)
     {
         EventLog.WriteEntry("RemoteRecorderBase->InitializeLogger() ", er.ToString(), EventLogEntryType.Error);
         return false;
     }
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:17,代码来源:Program.cs

示例2: Initialize_Logger

        public bool Initialize_Logger()
        {
            try
            {
                L = new CLogger();
                switch (trc_level)
                {
                    case 0:
                        {
                            L.SetLogLevel(LogLevel.NONE);
                        } break;
                    case 1:
                        {
                            L.SetLogLevel(LogLevel.INFORM);
                        } break;
                    case 2:
                        {
                            L.SetLogLevel(LogLevel.WARN);
                        } break;
                    case 3:
                        {
                            L.SetLogLevel(LogLevel.ERROR);
                        } break;
                    case 4:
                        {
                            L.SetLogLevel(LogLevel.DEBUG);
                        } break;
                }

                L.SetLogFile(err_log);
                L.SetTimerInterval(LogType.FILE, logging_interval);
                L.SetLogFileSize(log_size);
                return true;
            }
            catch (Exception er)
            {
                EventLog.WriteEntry("Security Manager NetScalerNetworkBalancerV_1_0_0Recorder Recorder", er.ToString(), EventLogEntryType.Error);
                return false;
            }
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:40,代码来源:Class1.cs

示例3: InitializeLogger

        private Boolean InitializeLogger()
        {
            try
            {
                _log = new CLogger();
                switch (_traceLevel)
                {
                    case 0: { _log.SetLogLevel(LogLevel.NONE); } break;
                    case 1: { _log.SetLogLevel(LogLevel.INFORM); } break;
                    case 2: { _log.SetLogLevel(LogLevel.WARN); } break;
                    case 3: { _log.SetLogLevel(LogLevel.ERROR); } break;
                    case 4: { _log.SetLogLevel(LogLevel.DEBUG); } break;
                }

                _log.SetLogFile(_errLog);
                _log.SetTimerInterval(LogType.FILE, logging_interval);
                _log.SetLogFileSize(_logSize);

                return true;
            }
            catch (Exception er)
            {
                EventLog.WriteEntry("Security Manager MCAffeeUTMSyslogRecorder", er.ToString(), EventLogEntryType.Error);
                return false;
            }
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:26,代码来源:MCAffeeUTMSyslogRecorder.cs

示例4: InitializeLogger

 public bool InitializeLogger()
 {
     try
     {
         L = new CLogger();
         L.SetLogLevel((LogLevel)((trcLevel < 0 || trcLevel > 4) ? 3 : trcLevel));
         L.SetLogFile(errLog);
         L.SetTimerInterval(LogType.FILE, loggingInterval);
         L.SetLogFileSize(logSize);
         return true;
     }
     catch (Exception er)
     {
         EventLog.WriteEntry("RemoteRecorderBase->InitializeLogger() ", er.ToString(), EventLogEntryType.Error);
         return false;
     }
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:17,代码来源:Class1.cs

示例5: Initialize_Logger

 public bool Initialize_Logger()
 {
     try
     {
         L = new CLogger();
         switch (trc_level)
         {
             case 0:
                 {
                     L.SetLogLevel(LogLevel.NONE);
                 } break;
             case 1:
                 {
                     L.SetLogLevel(LogLevel.INFORM);
                 } break;
             case 2:
                 {
                     L.SetLogLevel(LogLevel.WARN);
                 } break;
             case 3:
                 {
                     L.SetLogLevel(LogLevel.ERROR);
                 } break;
             case 4:
                 {
                     L.SetLogLevel(LogLevel.DEBUG);
                 } break;
         }
         if (!string.IsNullOrEmpty(LogLocation))
             err_log = Path.Combine(LogLocation, @"EventLogFileAuditRecorder" + Id + ".log");
         L.SetLogFile(err_log);
         L.SetTimerInterval(LogType.FILE, logging_interval);
         L.SetLogFileSize(log_size);
         return true;
     }
     catch (Exception er)
     {
         EventLog.WriteEntry("Security Manager RedHatSecure Recorder", er.ToString(), EventLogEntryType.Error);
         return false;
     }
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:41,代码来源:EventLogFileAuditRecorder.cs

示例6: ParserStub

        public ParserStub()
        {
            started = true;
              usingRegistry = true;
              usingKeywords = true;
              keywordsFound = false;
              startFromEndOnLoss = false;
              checkLineMismatch = true;
              lineLimit = 100;
              startLineCheckCount = 10;
              parsing = false;
              parseLock = new Mutex();
              disposeCheck = false;
              loadWatcher = false;
              readMethod = "sed";
              enc = Encoding.Default;

            #if STAYCONNECTED
            stayConnected = false;
            #endif

              Id = 0;

              /*checkTimer = new System.Timers.Timer(60000);
              checkTimer.Enabled = false;
              checkTimer.Elapsed += new System.Timers.ElapsedEventHandler(checkTimer_Elapsed);
              usingCheckTimer = false;*/

              checkTimerSSH = new System.Timers.Timer(10);
              checkTimerSSH.Enabled = false;
              checkTimerSSH.Elapsed += new System.Timers.ElapsedEventHandler(checkTimerSSH_Elapsed);

              Log = new CLogger();
              Log.SetLogLevel(LogLevel.ERROR);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:35,代码来源:ParserStub.cs

示例7: Initialize

        protected bool Initialize()
        {
            lock (_sync)
            {
                if ((_status & 2) == 2)
                    return true;
            }
            try
            {
                var logfile = ReadLogFilename();
                if (logfile != null)
                {
                    _logger = new CLogger();
                    _logger.SetLogFile(logfile);
                    _logger.SetLogLevel(ToLogLevel(_traceLevel, LogLevel.ERROR));

                    ProcessArgs();

                    lock (_sync)
                    {
                        _status |= 2;
                    }
                    return true;
                }
            }
            catch (Exception e)
            {
                EventLog.WriteEntry("Security Manager NatekMdmApacheRecorder Read Registry", e.ToString(), EventLogEntryType.Error);
            }
            return false;
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:31,代码来源:NatekMdmApacheRecorder.cs

示例8: Parser

        public Parser(String file)
        {
            FileName = file;

            LoadWatcher();

            started = true;

            Log = new CLogger();

            Log.SetLogLevel(LogLevel.ERROR);
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:12,代码来源:Parser.cs

示例9: InitializeLogger

 protected bool InitializeLogger()
 {
     try
     {
         L = new CLogger();
         switch (TrcLevel)
         {
             case 0:
                 {
                     L.SetLogLevel(LogLevel.NONE);
                 }
                 break;
             case 1:
                 {
                     L.SetLogLevel(LogLevel.INFORM);
                 }
                 break;
             case 2:
                 {
                     L.SetLogLevel(LogLevel.WARN);
                 }
                 break;
             case 3:
                 {
                     L.SetLogLevel(LogLevel.ERROR);
                 }
                 break;
             case 4:
                 {
                     L.SetLogLevel(LogLevel.DEBUG);
                 }
                 break;
         }
         L.SetLogFile(ErrLog);
         L.SetTimerInterval(LogType.FILE, LoggingInterval);
         L.SetLogFileSize(LogSize);
         return true;
     }
     catch (Exception er)
     {
         EventLog.WriteEntry("Security Manager IISUnified Recorder", er.ToString(), EventLogEntryType.Error);
         return false;
     }
 }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:44,代码来源:IISUnifiedRecorder.cs

示例10: InitializeLogger

        public Boolean InitializeLogger()
        {
            try
            {
                _log = new CLogger();

                switch (_traceLevel)
                {
                    case 0:
                        _log.SetLogLevel(LogLevel.NONE);
                        break;
                    case 1:
                        _log.SetLogLevel(LogLevel.INFORM);
                        break;
                    case 2:
                        _log.SetLogLevel(LogLevel.WARN);
                        break;
                    case 3:
                        _log.SetLogLevel(LogLevel.ERROR);
                        break;
                    case 4:
                        _log.SetLogLevel(LogLevel.DEBUG);
                        break;
                }

                _log.SetLogFile(_errLog);
                _log.SetTimerInterval(LogType.FILE, _loggingInterval);
                _log.SetLogFileSize(_logSize);

                return true;
            }
            catch (Exception ex)
            {
                EventLog.WriteEntry("Security Manager SQLServer Recorder", ex.ToString(), EventLogEntryType.Error);
                return false;
            }
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:37,代码来源:Class1.cs

示例11: InitializeLogger

        protected virtual NextInstruction InitializeLogger()
        {
            try
            {
                if (logger != null)
                    return NextInstruction.Do;
                if (String.IsNullOrEmpty(logFile))
                {
                    logFile = GetLogFileFromRegistry();
                    if (String.IsNullOrEmpty(logFile))
                        return NextInstruction.Abort;
                }

                logger = new CLogger();
                logger.SetLogLevel((LogLevel)traceLevel);
                logger.SetLogFile(logFile);
                logger.SetTimerInterval(logType, loggingInterval <= 0 ? 60000 : loggingInterval);
                logger.SetLogFileSize(logSize <= 0 ? 10 * 1024 * 1024 : logSize);
                return NextInstruction.Do;
            }
            catch (Exception er)
            {
                Log(LogLevel.ERROR, er.ToString());
                return NextInstruction.Abort;
            }
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:26,代码来源:RecorderBase.cs

示例12: Initialize_Logger

        //initialize logging informations
        public bool Initialize_Logger()
        {
            try
            {
                L = new CLogger();
                switch (trc_level)
                {
                    case 0:
                        {
                            L.SetLogLevel(LogLevel.NONE);
                        } break;
                    case 1:
                        {
                            L.SetLogLevel(LogLevel.INFORM);
                        } break;
                    case 2:
                        {
                            L.SetLogLevel(LogLevel.WARN);
                        } break;
                    case 3:
                        {
                            L.SetLogLevel(LogLevel.ERROR);
                        } break;
                    case 4:
                        {
                            L.SetLogLevel(LogLevel.DEBUG);
                        } break;
                }

                L.SetLogFile("EventLogViewer.log");
                L.SetTimerInterval(LogType.FILE, Convert.ToUInt32(logging_interval));
                L.SetLogFileSize(Convert.ToUInt32(log_size));

                return true;
            }
            catch (Exception er)
            {
                EventLog.WriteEntry("Security Manager JuniperSyslogRecorder Recorder", er.ToString(), EventLogEntryType.Error);
                return false;
            }
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:42,代码来源:Class1.cs

示例13: Initialize_Logger

        public bool Initialize_Logger()
        {
            try
            {
                _l = new CLogger();
                switch (_trcLevel)
                {
                    case 0:
                        {
                            _l.SetLogLevel(LogLevel.NONE);
                        } break;
                    case 1:
                        {
                            _l.SetLogLevel(LogLevel.INFORM);
                        } break;
                    case 2:
                        {
                            _l.SetLogLevel(LogLevel.WARN);
                        } break;
                    case 3:
                        {
                            _l.SetLogLevel(LogLevel.ERROR);
                        } break;
                    case 4:
                        {
                            _l.SetLogLevel(LogLevel.DEBUG);
                        } break;
                }

                _l.SetLogFile(_errLog);
                _l.SetTimerInterval(LogType.FILE, LoggingInterval);
                _l.SetLogFileSize(LogSize);

                return true;
            }
            catch (Exception er)
            {
                EventLog.WriteEntry("Security Manager CryptTechHotspotV_1_0_1Recorder", er.ToString(), EventLogEntryType.Error);
                return false;
            }
        }
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:41,代码来源:Class1.cs


注:本文中的CLogger.SetLogLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。