| | |
| | | package com.java110.service.init; |
| | | |
| | | import com.java110.core.log.LogAgent; |
| | | import com.java110.dto.system.SystemLogDto; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | |
| | | private static Environment env; |
| | | |
| | | public static void initSystemConfig(ApplicationContext context){ |
| | | public static void initSystemConfig(ApplicationContext context) { |
| | | //加载配置文件,注册订单处理侦听 |
| | | try { |
| | | ApplicationContextFactory.setApplicationContext(context); |
| | | env = context.getEnvironment(); |
| | | |
| | | String logSwitch = env.getProperty("LogSwitch"); |
| | | if(!StringUtil.isEmpty(logSwitch)){ |
| | | if (!StringUtil.isEmpty(logSwitch)) { |
| | | //设置日志级别 |
| | | LogAgent.setLogSwatch(logSwitch); |
| | | SystemLogDto.setLogSwatch(logSwitch); |
| | | } |
| | | } |
| | | catch (Exception ex) { |
| | | } catch (Exception ex) { |
| | | throw new IllegalStateException("系统初始化失败", ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void preInitSystemConfig() { |
| | | //加载配置文件,注册订单处理侦听 |
| | | String logSwitch = System.getenv("LogSwitch"); |
| | | if (!StringUtil.isEmpty(logSwitch)) { |
| | | //设置日志级别 |
| | | SystemLogDto.setLogSwatch(logSwitch); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |