/// <summary> /// 开始初始化基础日志 /// </summary> /// <param name="config">日志配置信息</param> public void Initialize(LoggingConfig config) { LogManager.SetEntryInfo(config.EntryConfig.Enabled, config.EntryConfig.EntryLogLevel); foreach (LoggingAdapterConfig adapterConfig in config.BasicLoggingConfig.AdapterConfigs) { SetLoggingFromAdapterConfig(adapterConfig); } }
/// <summary> /// 日志配置信息重置 /// </summary> /// <param name="config">待重置的日志配置信息</param> /// <returns>重置后的日志配置信息</returns> public LoggingConfig Reset(LoggingConfig config) { if (config.BasicLoggingConfig.AdapterConfigs.Count == 0) { config.BasicLoggingConfig.AdapterConfigs.Add(new LoggingAdapterConfig() { AdapterType = typeof(Log4NetLoggerAdapter) }); } return config; }
/// <summary> /// 初始化一个心得<see cref="OSkyConfig"/>实例 /// </summary> private OSkyConfig() { OSkyFrameworkSection section = (OSkyFrameworkSection)ConfigurationManager.GetSection(OSkySectionName); if (section == null) { DataConfig = new DataConfig(); LoggingConfig = new LoggingConfig(); return; } DataConfig = new DataConfig(section.Data); LoggingConfig = new LoggingConfig(section.Logging); }
/// <summary> /// 初始化一个心得<see cref="OSkyConfig"/>实例 /// </summary> private OSkyConfig() { OSkyFrameworkSection section = (OSkyFrameworkSection)ConfigurationManager.GetSection(OSkySectionName); if (section == null) { DataConfig = new DataConfig(); LoggingConfig = new LoggingConfig(); return; } DataConfig = new DataConfig(section.Data); LoggingConfig = new LoggingConfig(section.Logging); }