当前的日志级别是error
LOGGER.info("保存出错!" + user);
应该改为:
LOGGER.error("保存出错!" + user);
例1:日志级别为error
public Result resetUserPwd(User user) { Result rs = new Result(); try { User loginUser = (User) SessionCache.get(); user.setUpdateBy(loginUser.getUserName()); userMapper.updateByPrimaryKeySelective(user); } catch (Exception e) { logger.error("重置密码出错-->" + e.getMessage()); rs.setSuccess(false); rs.setMsg(e.getMessage()); } return rs; }
例2:日志级别为info
if (userId == null) { logger.info("userId不能为空"); return Result.operating("userId不能为空", false, ResultCode.SUCCESS); }