Skip to content

Commit

Permalink
配置日志文件输出
Browse files Browse the repository at this point in the history
  • Loading branch information
gongfukangEE committed Jun 10, 2019
1 parent ee5e007 commit 5473a68
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 108 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Built application files and Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

# Compiled class file
*.class

Expand Down
126 changes: 68 additions & 58 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public String initDBAndRedisBefore(HttpServletRequest request) {
} catch (Exception e) {
log.error("Exception: ", e);
}
if (res == 1) {
log.info("重置数据库和缓存成功!");
}
return res == 1 ? success : error;
}

Expand Down Expand Up @@ -120,7 +123,7 @@ public String createOrderWithLimitAndRedis(HttpServletRequest request, int sid)
if (RedisLimit.limit()) {
res = orderService.createOrderWithLimitAndRedis(sid);
if (res == 1) {
log.info("下单成功...");
log.info("秒杀成功");
}
}
} catch (Exception e) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 日志
logging.file=secondkill.log
logging.level.root=info

# 数据库
spring.datasource.url=jdbc:mysql://47.106.218.181:3306/seconds_kill?useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
Expand Down
26 changes: 0 additions & 26 deletions target/classes/application.properties

This file was deleted.

Loading

0 comments on commit 5473a68

Please sign in to comment.