示例#1
0
 public void OnUserRemovedEvent(IWriteLog w, string message)
 {
     if (UserRemoved != null)
     {
         UserRemoved(w, message);
     }
 }
示例#2
0
 public HttpRequestManager(HttpClient client, IMemoryCache memoryCache, IWriteLog writeLog, IHttpContextAccessor httpContext, IConfiguration configuration)
 {
     _client        = client;
     _memoryCache   = memoryCache;
     _writeLog      = writeLog;
     _httpContext   = httpContext;
     _configuration = configuration;
 }
示例#3
0
 public BaseService(HttpClient client, IConfiguration configuration, IMemoryCache memoryCache, IWriteLog writeLog, IHttpContextAccessor httpContext)
 {
     _client        = client;
     _configuration = configuration;
     _memoryCache   = memoryCache;
     _writeLog      = writeLog;
     _httpContext   = httpContext;
 }
示例#4
0
        /// <summary>
        /// 注册启动KLog
        /// </summary>
        /// <param name="host">主Host,如jbk、ypk、console</param>
        public static void Register(string host)
        {
            if (_logConsumers != null)
            {
                return;
            }

            _logConsumers = new List <Log>();
            _logProducers = new List <Log>();
            var connStr = ConfigurationManager.AppSettings["KLogConnStr"];

            //默认间隔1分钟写一次日志
            _waitTime = 60000;

            try
            {
                _level = int.Parse(ConfigurationManager.AppSettings["KLogLevel"]);
            }
            catch
            {
                //默认除了debug的日志外都记录
                _level = 2;
            }

            try
            {
                //记录日志的方式(File文本,Mongodb、Sqlserver、Mysql、Oracle数据库,Excel表格。需要的自己去仿照LogByMongodb实现)
                var logMode = "Core.LogBy" + ConfigurationManager.AppSettings["KLogBy"];
                //抽象工厂模式初始化日志类
                var type = Type.GetType(logMode, true);
                _log = (IWriteLog)Activator.CreateInstance(type);
            }
            catch (Exception ex)
            {
                //默认用文本记录日志
                _log = new LogByFile();
            }


            _log.Init(host, connStr);
            Warn("进程启动!");
        }
 public MyNvLogProvider(IWriteLog writeLog, LogConfiguration logConfiguration)
 {
     _writeLog         = writeLog;
     _logConfiguration = logConfiguration;
 }
示例#6
0
 public InserisciRichiestaSoccorsoAereo(HttpClient client, IConfiguration configuration, IMemoryCache cache, IWriteLog log, IHttpContextAccessor accessor)
     : base(client, configuration, cache, log, accessor)
 {
 }
示例#7
0
 public SetUscitaMezzo(HttpClient client, IConfiguration configuration, IMemoryCache memoryCache, IWriteLog writeLog, IHttpContextAccessor httpContext)
     : base(client, configuration, memoryCache, writeLog, httpContext)
 {
 }
示例#8
0
 public GetMezziUtilizzabili(HttpClient client, IConfiguration configuration, IGetStatoMezzi GetStatoMezzi,
                             IGetDistaccamentoByCodiceSedeUC GetDistaccamentoByCodiceSedeUC,
                             IGetAlberaturaUnitaOperative getAlberaturaUnitaOperative,
                             IMemoryCache memoryCache, IGetPosizioneFlotta getPosizioneFlotta, IWriteLog writeLog, IHttpContextAccessor httpContext)
     : base(client, configuration, memoryCache, writeLog, httpContext)
 {
     _getStatoMezzi = GetStatoMezzi;
     _getDistaccamentoByCodiceSedeUC = GetDistaccamentoByCodiceSedeUC;
     _getAlberaturaUnitaOperative    = getAlberaturaUnitaOperative;
     _getPosizioneFlotta             = getPosizioneFlotta;
 }
示例#9
0
 public static void Error(IWriteLog s, string mes)
 {
     s.WriteTextLog(mes);
 }
示例#10
0
 public static void Warning(IWriteLog s, string mes)
 {
     s.WriteTextLog(mes);
 }
示例#11
0
 public static void Info(IWriteLog s, string mes)
 {
     s.WriteTextLog(mes);
 }
示例#12
0
 public GetToken(HttpClient client, IConfiguration configuration, IMemoryCache memoryCache, IWriteLog writeLog, IHttpContextAccessor httpContext)
     : base(client, configuration, memoryCache, writeLog, httpContext)
 {
 }
示例#13
0
 public GetTipologieSoccorsoAereo(HttpClient client, IConfiguration configuration, IMemoryCache cache, IWriteLog log, IHttpContextAccessor httpContext)
     : base(client, configuration, cache, log, httpContext)
 {
 }