Esempio n. 1
0
        /// <summary>
        /// 初始化日志
        /// </summary>
        static Logger()
        {
            ReleaseRefDLL("zlib32.dll", Properties.Resources.zlib32);
            ReleaseRefDLL("zlib64.dll", Properties.Resources.zlib64);

            var logger = LoggerFactory.CreateLogger(Config.Environment);

            _tokenBucket = new TokenBucket <LogBase>(Config.MaxHandleNum);

            _monitor = new LogMonitor <LogBase>(Config.MaxThrdNum, Config.MaxUploadNum, _tokenBucket);
            _monitor.Start(logger);
        }
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(FileName))
            {
                _logMonitor.FileName = FileName;
            }

            switch (_logMonitor.State)
            {
            case LogMonitor.LogHandlerState.Stopped:
            case LogMonitor.LogHandlerState.Pausing:
                _logMonitor.Start();
                break;

            case LogMonitor.LogHandlerState.Started:
                _logMonitor.Pause();
                break;
            }

            SetState();
        }