fix logfile

main
lwy 2 years ago
parent 81c594a4ec
commit 73b44f6aab

File diff suppressed because it is too large Load Diff

@ -2,6 +2,8 @@ package top.liangwy.read_statistics.controller;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@ -24,11 +26,10 @@ import java.util.*;
* @
*/
@Controller
@Slf4j
@RequestMapping("/wb")
public class WbController extends BaseController {
// private static final Logger logger = LoggerFactory.getLogger(WbController.class);
private static final Logger logger = LoggerFactory.getLogger(WbController.class);
@GetMapping("/today")
public String today(Model model) {
@ -48,9 +49,9 @@ public class WbController extends BaseController {
if (null == wbUserScanString) {
status = 1;
} else {
log.info("微博点赞评论人员是:" + wbUserScanString);
logger.info("微博点赞评论人员是:" + wbUserScanString);
String newWbUserScanString = wbFree + wbUserScanString.replace(" ", "");
log.info(newWbUserScanString);
logger.info(newWbUserScanString);
String[] a = newWbUserScanString.split(",");
model.addAttribute("date", year + "年" + month + "月" + day + "日");
@ -100,10 +101,10 @@ public class WbController extends BaseController {
WbMapper wbMapper = sqlSession.getMapper(WbMapper.class);
//因为微博复制出来的有两个空行,去掉后再存入数据库
log.info("前端页面传入的wbUserScanList: " + wbUserScanList);
logger.info("前端页面传入的wbUserScanList: " + wbUserScanList);
String str = wbUserScanList.replace("\r\n\r\n", ",");
String newWbUserScanList = wbFree + str;
log.info("准备要输入数据库中的newWbUserScanList: " + newWbUserScanList);
logger.info("准备要输入数据库中的newWbUserScanList: " + newWbUserScanList);
int i = wbMapper.setWbUserScanList(newWbUserScanList);
if (i == 1) {
//插入成功

@ -1,8 +0,0 @@
server.port=8080
spring.datasource.url=jdbc:mysql://39.97.211.66:3306/dblwy?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
spring.datasource.username=DBLwy
spring.datasource.password=tx8yH88dJseWt72x
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
mybatis.type-aliases-package=top.liangwy.read_statistics.cyc.pojo
mybatis.mapper-locations=classpath:/dao/*.xml

@ -11,7 +11,7 @@
<fileNamePattern>logs/myapp.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">

Loading…
Cancel
Save