code: public static void initLogConfig(String logConfigpath)
  	{
  		try {
  			LoggerContext context =(LoggerContext)LogManager.getContext(false);
  			if(context!=null)
  			{
  				 context.setConfigLocation(new File(logConfigpath).toURI());
  			     context.reconfigure();//重新初始化Log4j2的配置上下文
  			}else
  			{
  				ConfigurationSource source = new ConfigurationSource(new FileInputStream(logConfigpath));
  				Configurator.initialize(null, source);
  			}
  			Logger log=LoggerFactory.getLogger(Log4jUtil.class);
  			log.info("日志配置初始化完成:"+logConfigpath);
  		} catch (FileNotFoundException e) {
  			e.printStackTrace();
  		} catch (IOException e) {
  			e.printStackTrace();
  		}  
  	}
docs: 根据配置文件路径初始化日志配置
  @param logConfigpath