From 4dd289d87d2dfa7481a55c62f9e9dc4520b10153 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4U0TDEF\\20371" <2037158277@qq.com> Date: Wed, 14 Jul 2021 17:35:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 15 +++ .../service/impl/FirePointServiceImpl.java | 5 + .../service/impl/SysAuthorityServiceImpl.java | 2 - .../xkrs/service/impl/SysRoleServiceImpl.java | 2 - .../xkrs/service/impl/SysUserServiceImpl.java | 2 - src/main/resources/log4j2.xml | 100 ++++++++++++++++++ 6 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/log4j2.xml 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