public CacheManage()
        {
            var         config = ConfigurationManage.GetConfiguration($"configuration:{Id}");
            RedisHelper redis  = new RedisHelper(config);

            SingletonUtility.AddSingleton(redis);
        }
Beispiel #2
0
        protected virtual void Config()
        {
            var config = ConfigurationManage.GetConfiguration($"configuration:6D5AD3FC-EB8E-403E-8C2A-426E87FA7CFA");

            if (config == null)
            {
                throw new Exception("日志配置未找到!");
            }
            ILoggerRepository repository = LogManager.CreateRepository("SysLogger");

            XmlConfigurator.Configure(repository, config.ToStream());
            log = LogManager.GetLogger(repository.Name, "SysLogger");
        }
        public LoggerManage()
        {
            var config = ConfigurationManage.GetConfiguration($"configuration:{Id}");

            if (config == null)
            {
                var cg = new ConfigurationModel
                {
                    Content     = File.ReadAllText("log4net.config"),
                    Runtime     = Environment.GetEnvironmentVariable("Runtime"),
                    Description = "日志"
                };
                IList <ConfigurationModel> cgl = new List <ConfigurationModel>();
                cgl.Add(cg);
                config = cg.Content;
                ConfigurationManage.SetConfiguration($"configuration:{Id}", cgl);
            }
            ILoggerRepository repository = LogManager.CreateRepository("SysLogger");

            XmlConfigurator.Configure(repository, config.ToStream());
            ILog log = LogManager.GetLogger(repository.Name, "SysLogger");

            SingletonUtility.AddSingleton(log);
        }