diff --git a/pom.xml b/pom.xml index 2818592..5df0585 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,21 @@ spring-boot-starter-test test + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + + + + org.springframework.boot + spring-boot-starter-log4j2 + org.apache.commons commons-pool2 diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index ee9666f..632dd98 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -6,6 +6,8 @@ import com.xkrs.model.qo.FirePointQo; import com.xkrs.service.FirePointService; import com.xkrs.utils.AddressUtils; import com.xkrs.utils.DateTimeUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -17,6 +19,8 @@ import java.time.LocalDateTime; @Service public class FirePointServiceImpl implements FirePointService { + public static Logger log = LoggerFactory.getLogger(FirePointServiceImpl.class); + @Resource private FirePointDao firePointDao; @@ -40,6 +44,7 @@ public class FirePointServiceImpl implements FirePointService { firePointEntity.setConfidence(firePointQo.getConfidence()); firePointEntity.setAddTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); firePointEntity.setFireType("0"); + log.info("-------发现新火点"); return firePointDao.save(firePointEntity); } diff --git a/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java index c8d845a..84e7088 100644 --- a/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SysAuthorityServiceImpl.java @@ -18,8 +18,6 @@ import java.util.List; @Service public class SysAuthorityServiceImpl implements SysAuthorityService { - Logger logger = LoggerFactory.getLogger(SysAuthorityServiceImpl.class); - @Resource private SysAuthorityDao sysAuthorityDao; diff --git a/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java index 4cb3bd2..59f430a 100644 --- a/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SysRoleServiceImpl.java @@ -17,8 +17,6 @@ import java.util.List; @Service public class SysRoleServiceImpl implements SysRoleService { - Logger logger = LoggerFactory.getLogger(SysRoleServiceImpl.class); - @Resource private SysRoleDao sysRoleDao; diff --git a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java index bf71fc5..a50cf39 100644 --- a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java @@ -37,8 +37,6 @@ import static com.xkrs.utils.EncryptDecryptUtil.encry256; @Service public class SysUserServiceImpl implements SysUserService { - Logger logger = LoggerFactory.getLogger(SysUserServiceImpl.class); - @Resource private SysUserDao sysUserDao; diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..1c812e2 --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file