# ale-error-message **Repository Path**: xpsdjl/ale-error-message ## Basic Information - **Project Name**: ale-error-message - **Description**: ale自定义业务日志 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-12-16 - **Last Updated**: 2023-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 1、error-msg的路径设置(不建议配置该属性) > 在自己的项目中的配置文件中可以设置下面属性来指定自己的error信息日志 > cool.ale.error.message.message.path=E:/AleProject/ale-stock/src/main/resources/error/ > 如果不配置该属性,系统将默认从resource/error路径下去找对应的文件然后解析,文件模板在 autoconfigure 包中的 resource/error 路径下 # 2、error-msg的生效语言设置 > cool.ale.error.message.message.effectLanguage=EN_US > 通过上面的配置去设置生效的语言,默认会加载设置的后缀名的文件,拿出业务异常信息 # 3、error-msg的业务异常信息在redis中存储的前置名称设置(建议配置成功工程名) > cool.ale.error.message.message.error-message-prefix-name-one: MERCHANT_MANAGE > 这个属性的含义是当多个系统的业务异常信息如果同时注册到同一个redis服务的时候,如果业务信息文件里面的key有重复的,那就会产生redis中覆盖掉业务异常信息的情况,所以一般建议配置成工程名 # 4、引入redis提高效率 > 本包为了提高效率,可以引入redis对其效率进行提高,如果需要,需要在源项目中写上如下代码,引入相对应的 JedisPool , 该 JedisPool 在 ioc 中的名称必须是 aleErrorMessageJedisPool 。 ```java /** * AleErrorMessage 所使用的 jedisPool * @return 返回初始化的 JedisPool */ @Bean public JedisPool aleErrorMessageJedisPool(){ JedisPoolConfig jedisPoolConfig=new JedisPoolConfig(); // 资源池中的最大连接数 jedisPoolConfig.setMaxTotal(redisParam.getMaxTotal()); // 资源池允许的最大空闲连接数 jedisPoolConfig.setMaxIdle(redisParam.getMaxIdle()); // 资源池确保的最少空闲连接数 jedisPoolConfig.setMinIdle(redisParam.getMinIdle()); // 连接redis并整合jedis池 JedisPool jedisPool=new JedisPool( jedisPoolConfig, redisParam.getHost(), redisParam.getPort(), redisParam.getTimeout(), redisParam.getPassword()); log.info("AleErrorMessage的JedisPool连接成功,host:{},port:{}", redisParam.getHost(), redisParam.getPort()); return jedisPool; } ```