删除 Graylog 分布式日志框架,改为 SkyWalking 接管日志
This commit is contained in:
parent
49543f214f
commit
5608b378f1
230
README.md
230
README.md
@ -1 +1,231 @@
|
||||
# 小鹿超市项目
|
||||
|
||||
## 后端技术栈
|
||||
|
||||
| 核心技术 |
|
||||
| :----------------------------------------------------------- |
|
||||
| SpringBoot:简化新Spring应用的初始搭建以及开发过程 |
|
||||
| SpringCloud:基于Spring Boot实现的云原生应用开发工具,SpringCloud使用的技术:(Spring Cloud Gateway、Spring Cloud OpenFeign、Spring Cloud Alibaba Nacos等) |
|
||||
| MyBatis-Plus:持久层框架 |
|
||||
| Redis:缓存数据库 |
|
||||
| Redisson:基于redis的Java驻内存数据网格,实现分布式锁 |
|
||||
| RabbitMQ:消息中间件 |
|
||||
| ElasticSearch + Kibana: 全文检索服务器 +可视化数据监控 |
|
||||
| ThreadPoolExecutor:线程池来实现异步操作,提高效率 |
|
||||
| OSS/MinIO:文件存储服务 |
|
||||
| Knife4j(Swagger):Api接口文档工具 |
|
||||
| Nginx:负载均衡 |
|
||||
| MySQL:关系型数据库 |
|
||||
| 微信支付 |
|
||||
| 微信小程序 |
|
||||
| Docker:容器技术 |
|
||||
| DockerFile:管理Docker镜像命令文本 |
|
||||
| SkyWalking:链路追踪、日志、监控框架 |
|
||||
| |
|
||||
| |
|
||||
|
||||
## 前端技术栈
|
||||
|
||||
| 核心技术 |
|
||||
| ------------------ |
|
||||
| UinApp |
|
||||
| vue-admin-template |
|
||||
| ElementUI |
|
||||
| Axios |
|
||||
| Node.js |
|
||||
| Npm |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|
||||
|
||||
|
||||
## 开发工具
|
||||
|
||||
| 开发工具 | 版本 |
|
||||
| ----------------------------- | -------------- |
|
||||
| Intellil IDEA Ultimate | 2023.3.2 |
|
||||
| DataGrip | 2023.3.2 |
|
||||
| WebStorm | 2023.3.2 |
|
||||
| HBuilderx | 3.8.12 |
|
||||
| Google Chrome | 120.0.6099.216 |
|
||||
| Another Redis Desktop Manager | 1.6 |
|
||||
| Apifox | 2.3.19 |
|
||||
| Parallels Desktop | 18.1.1 |
|
||||
| Termius | 8.4.0 |
|
||||
| 微信开发者工具 | 1.06.2306020 |
|
||||
|
||||
## 操作系统
|
||||
|
||||
| 开发工具 | 版本 |
|
||||
| ------------------- | ------ |
|
||||
| Mac OS Ventura | 13.6.3 |
|
||||
| Linux CentOS Stream | 9 |
|
||||
| Linux CentOS | 7.9 |
|
||||
|
||||
## 项目环境部署
|
||||
|
||||
### Mysql 数据库
|
||||
|
||||
```shell
|
||||
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:latest
|
||||
```
|
||||
|
||||
### Redis 缓存
|
||||
|
||||
```shell
|
||||
docker run -itd --name redis -p 6379:6379 redis
|
||||
```
|
||||
|
||||
### RabbitMQ 消息队列
|
||||
|
||||
```shell
|
||||
docker run -d --restart=always -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3.8-management
|
||||
|
||||
docker exec -it rabbit /bin/bash
|
||||
#安装插件
|
||||
rabbitmq-plugins enable rabbitmq_management
|
||||
```
|
||||
|
||||
### Nacos 注册中心
|
||||
|
||||
```shell
|
||||
docker run -d --name nacos-server -p 8848:8848 -p 9848:9848 \
|
||||
-e MODE=standalone \
|
||||
-e JVM_XMS=512m \
|
||||
-e JVM_XMX=512m \
|
||||
-v /logs/nacos:/home/nacos/logs \
|
||||
nacos/nacos-server:v2.2.3
|
||||
```
|
||||
|
||||
### ES + Kibana 分词器
|
||||
|
||||
```shell
|
||||
docker run -p 9200:9200 -p 9300:9300 --name elasticsearch \
|
||||
-e "discovery.type=single-node" \
|
||||
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
|
||||
-d elasticsearch:7.8.0
|
||||
|
||||
docker exec -it elasticsearch /bin/bash
|
||||
|
||||
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.17.5/elasticsearch-analysis-ik-7.17.5.zip
|
||||
|
||||
docker restart elasticsearch
|
||||
|
||||
docker run -d --name kibana --link elasticsearch:elasticsearch -p 5601:5601 kibana:7.8.0
|
||||
```
|
||||
|
||||
### GrayLog 日志框架 (已弃用,日志服务整合到 SkyWalking)
|
||||
|
||||
```shell
|
||||
#部署Elasticsearch
|
||||
docker run -d \
|
||||
--name elasticsearch \
|
||||
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
|
||||
-e "discovery.type=single-node" \
|
||||
-v es-data:/usr/share/elasticsearch/data \
|
||||
-v es-plugins:/usr/share/elasticsearch/plugins \
|
||||
--privileged \
|
||||
-p 9200:9200 \
|
||||
-p 9300:9300 \
|
||||
elasticsearch:7.17.5
|
||||
|
||||
#部署MongoDB(使用之前部署的服务即可)
|
||||
docker run -d \
|
||||
--name mongodb \
|
||||
-p 27017:27017 \
|
||||
--restart=always \
|
||||
-v mongodb:/data/db \
|
||||
-e MONGO_INITDB_ROOT_USERNAME=xlcs \
|
||||
-e MONGO_INITDB_ROOT_PASSWORD=123321 \
|
||||
mongo:4.4
|
||||
|
||||
#部署
|
||||
docker run \
|
||||
--name graylog \
|
||||
-p 9000:9000 \
|
||||
-p 12201:12201/udp \
|
||||
-e GRAYLOG_HTTP_EXTERNAL_URI=http://<IP>:9000/ \
|
||||
-e GRAYLOG_ELASTICSEARCH_HOSTS=http://<IP>:9200/ \
|
||||
-e GRAYLOG_ROOT_TIMEZONE="Asia/Shanghai" \
|
||||
-e GRAYLOG_WEB_ENDPOINT_URI="http://<IP>:9000/:9000/api" \
|
||||
-e GRAYLOG_PASSWORD_SECRET="somepasswordpepper" \
|
||||
-e GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 \
|
||||
-e GRAYLOG_MONGODB_URI=mongodb://xlcs:123321@<IP>:27017/admin \
|
||||
-d \
|
||||
graylog/graylog:4.3
|
||||
```
|
||||
|
||||
### SkyWalking 链路追踪、日志、监控框架
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
services:
|
||||
elasticsearch:
|
||||
image: elasticsearch:8.4.2
|
||||
container_name: elasticsearchsky
|
||||
ports:
|
||||
- "9200:9200"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health || exit 1"] #⼼跳检测,成功之后不再执⾏后⾯的退出
|
||||
interval: 60s #⼼跳检测间隔周期
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s #⾸次检测延迟时间
|
||||
environment:
|
||||
discovery.type: single-node #单节点模式
|
||||
ingest.geoip.downloader.enabled: "false"
|
||||
bootstrap.memory_lock: "true"
|
||||
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
|
||||
TZ: "Asia/Shanghai"
|
||||
xpack.security.enabled: "false" #单机模式
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
skywalking-oap:
|
||||
image: apache/skywalking-oap-server:9.4.0
|
||||
container_name: skywalking-oap
|
||||
depends_on:
|
||||
elasticsearch:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- elasticsearch
|
||||
environment:
|
||||
SW_HEALTH_CHECKER: default
|
||||
SW_STORAGE: elasticsearch
|
||||
SW_STORAGE_ES_CLUSTER_NODES: 124.70.87.134:9200
|
||||
JAVA_OPTS: "-Xms2048m -Xmx2048m"
|
||||
TZ: Asia/Shanghai
|
||||
SW_TELEMETRY: prometheus
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "/skywalking/bin/swctl ch"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
restart: on-failure
|
||||
ports:
|
||||
- "11800:11800"
|
||||
- "12800:12800"
|
||||
skywalking-ui:
|
||||
image: apache/skywalking-ui:9.4.0
|
||||
container_name: skywalking-ui
|
||||
depends_on:
|
||||
skywalking-oap:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- skywalking-oap
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
SW_OAP_ADDRESS: http://124.70.87.134:12800
|
||||
SW_HEALTH_CHECKER: default
|
||||
TZ: Asia/Shanghai
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -sf http://localhost:8080 || exit 1"] #⼼跳检测,成功之后不再执⾏后⾯的退出
|
||||
interval: 60s #⼼跳检测间隔周期
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s #⾸次检测延迟时间
|
||||
```
|
||||
|
@ -12,10 +12,25 @@
|
||||
<artifactId>service-gateway</artifactId>
|
||||
<dependencies>
|
||||
<!-- 日志采集框架-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>biz.paluch.logging</groupId>-->
|
||||
<!-- <artifactId>logstash-gelf</artifactId>-->
|
||||
<!-- <version>1.15.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 如果想在项目代码中获取链路TraceId,则需要引入此依赖 -->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.skywalking/apm-toolkit-trace -->
|
||||
<dependency>
|
||||
<groupId>biz.paluch.logging</groupId>
|
||||
<artifactId>logstash-gelf</artifactId>
|
||||
<version>1.15.0</version>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-trace</artifactId>
|
||||
<version>9.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- skywalking logback插件 -->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.skywalking/apm-toolkit-logback-1.x -->
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
||||
<version>9.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yovinchen</groupId>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
</appender>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<!-- <logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">-->
|
||||
<!-- <appender-ref ref="DRUID_FILE"/>-->
|
||||
<!-- <appender-ref ref="CONSOLE"/>-->
|
||||
<!-- </logger>-->
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -32,11 +32,28 @@
|
||||
<version>3.9.1</version>
|
||||
</dependency>
|
||||
<!-- 日志采集框架-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>biz.paluch.logging</groupId>-->
|
||||
<!-- <artifactId>logstash-gelf</artifactId>-->
|
||||
<!-- <version>1.15.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 如果想在项目代码中获取链路TraceId,则需要引入此依赖 -->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.skywalking/apm-toolkit-trace -->
|
||||
<dependency>
|
||||
<groupId>biz.paluch.logging</groupId>
|
||||
<artifactId>logstash-gelf</artifactId>
|
||||
<version>1.15.0</version>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-trace</artifactId>
|
||||
<version>9.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- skywalking logback插件 -->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.skywalking/apm-toolkit-logback-1.x -->
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
||||
<version>9.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--依赖服务的工具类-->
|
||||
<dependency>
|
||||
<groupId>com.yovinchen</groupId>
|
||||
|
@ -1,14 +1,15 @@
|
||||
package com.yovinchen.xlcs.acl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yovinchen.xlcs.acl.mapper.AdminMapper;
|
||||
import com.yovinchen.xlcs.acl.service.AdminService;
|
||||
import com.yovinchen.xlcs.acl.service.RoleService;
|
||||
import com.yovinchen.xlcs.model.acl.Admin;
|
||||
import com.yovinchen.xlcs.vo.acl.AdminQueryVo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
@ -21,6 +22,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 10:44
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {
|
||||
|
||||
@ -32,6 +34,7 @@ public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements
|
||||
|
||||
@Override
|
||||
public IPage<Admin> selectPage(Page<Admin> pageParam, AdminQueryVo userQueryVo) {
|
||||
log.info("获取管理用户分页列表入参{}", pageParam.toString() + userQueryVo.toString());
|
||||
//获取用户名称条件值
|
||||
String name = userQueryVo.getName();
|
||||
//创建条件构造器
|
||||
|
@ -10,7 +10,7 @@
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -107,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -127,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -170,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -181,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<configuration>
|
||||
<!-- 引入默认设置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<!--文件名-->
|
||||
<!-- 编码格式设置 -->
|
||||
<property name="ENCODING" value="UTF-8"/>
|
||||
<!-- 日志文件的存储地址,由application.yml中的logging.path配置,根路径默认同项目路径 -->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<!-- <property name="LOG_HOME" value="${LOG_PATH:-./logs}"/>-->
|
||||
<property name="LOG_HOME" value="/Users/yovinchen/Desktop/project/xlcs/xlcs-parent/data/logs"/>
|
||||
<property name="LOG_FILE_MAX_SIZE" value="100MB"/>
|
||||
<property name="LOG_FILE_MAX_HISTORY" value="180"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/debug/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -60,7 +60,7 @@
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/info/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -85,7 +85,6 @@
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/error/${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -108,7 +107,7 @@
|
||||
<appender name="DRUID_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--设置文件命名格式-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<!-- <FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${POD_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>-->
|
||||
<FileNamePattern>${LOG_HOME}/${APP_NAME}/druid/SlowSql_${APP_NAME}-%d{yyyy-MM-dd}-%i.log</FileNamePattern>
|
||||
<!--设置日志文件大小,超过就重新生成文件,默认10M-->
|
||||
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
|
||||
@ -128,39 +127,48 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
|
||||
<!--GrayLog服务地址-->
|
||||
<host>udp:10.211.55.50</host>
|
||||
<!--GrayLog服务端口-->
|
||||
<port>12201</port>
|
||||
<version>1.1</version>
|
||||
<!--当前服务名称-->
|
||||
<facility>${APP_NAME}</facility>
|
||||
<extractStackTrace>true</extractStackTrace>
|
||||
<filterStackTrace>true</filterStackTrace>
|
||||
<mdcProfiling>true</mdcProfiling>
|
||||
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
|
||||
<maximumMessageSize>8192</maximumMessageSize>
|
||||
<!-- <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">-->
|
||||
<!-- <!–GrayLog服务地址–>-->
|
||||
<!-- <host>udp:10.211.55.50</host>-->
|
||||
<!-- <!–GrayLog服务端口–>-->
|
||||
<!-- <port>12201</port>-->
|
||||
<!-- <version>1.1</version>-->
|
||||
<!-- <!–当前服务名称–>-->
|
||||
<!-- <facility>${APP_NAME}</facility>-->
|
||||
<!-- <extractStackTrace>true</extractStackTrace>-->
|
||||
<!-- <filterStackTrace>true</filterStackTrace>-->
|
||||
<!-- <mdcProfiling>true</mdcProfiling>-->
|
||||
<!-- <timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>-->
|
||||
<!-- <maximumMessageSize>8192</maximumMessageSize>-->
|
||||
<!-- </appender>-->
|
||||
<property name="APM_PATTERN"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n"/>
|
||||
<!-- skyWalking日志采集 -->
|
||||
<appender name="APM_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>${APM_PATTERN}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- ======开发环境:打印控制台和输出到文件====== -->
|
||||
<springProfile name="dev"><!-- 由application.yml中的spring.profiles.active配置 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -171,7 +179,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
@ -182,7 +191,8 @@
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="GELF"/>
|
||||
<appender-ref ref="APM_LOG"/>
|
||||
<!-- <appender-ref ref="GELF"/>-->
|
||||
</root>
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
@ -128,12 +128,11 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- ===日志输出级别,OFF level > FATAL > ERROR > WARN > INFO > DEBUG > ALL level=== -->
|
||||
<logger name="com.asiainfo" level="INFO"/>
|
||||
<logger name="com.yovinchen" level="INFO"/>
|
||||
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="INFO"/>
|
||||
<logger name="org.springframework" level="WARN"/>
|
||||
<logger name="com.baomidou.mybatisplus" level="WARN"/>
|
||||
<logger name="org.apache.kafka.clients.NetworkClient" level="INFO"/>
|
||||
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
|
||||
|
||||
<!--druid相关logger,-->
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR">
|
||||
<appender-ref ref="DRUID_FILE"/>
|
||||
|
Loading…
Reference in New Issue
Block a user