Example #1
0
        public static LogMessage CreateHandleLogEntity(string logType, string iKey)
        {
            var handlelog = new LogMessage
            {
                Ikey     = iKey,
                Username = "******",
                Module   = "nomodule",
                LogType  = logType,
                Content  = "nocontent",
                IsHandle = false,
                Keyword  = "nokeyword",
                OrderNo  = "noorderno",
                ClientIP = ClientHelper.GetClientIP(),
                ServerIP = IPHelper.GetLocalIP(),
            };

            if (string.IsNullOrEmpty(iKey))
            {
                handlelog.Ikey = Guid.NewGuid().ToString();
            }
            return(handlelog);
        }
Example #2
0
        static DBLog()
        {
            try
            {
                s_localServerIP = IPHelper.GetLocalIP();

                s_logHandlePool = new DataBufferPool(AppSetting.DataBufferPoolSize, AppSetting.DataBufferSize,
                                                     TimeSpan.FromSeconds(AppSetting.AutoFlushSecond));
                s_logHandlePool.OnDataHandle += OnSendRequest;
                s_logHandlePool.TimerFlushAsync();

                s_logProcessPool = new DataBufferPool(AppSetting.DataBufferPoolSize, AppSetting.DataBufferSize,
                                                      TimeSpan.FromSeconds(AppSetting.AutoFlushSecond), false);
                s_logProcessPool.OnDataHandle += OnSendRequest;
                s_logProcessPool.TimerFlushAsync();

                m_localLog.Info("初始化DataBufferPool成功");
            }
            catch (Exception ex)
            {
                m_localLog.Error(ex);
            }
        }