切换日志到log4j2

This commit is contained in:
谷成伟 2024-12-27 11:11:28 +08:00
parent e2440a72b2
commit e0f7f3cc43
5 changed files with 28 additions and 8 deletions

View File

@ -44,9 +44,17 @@
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 使用log4j2代替logback-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- web 容器使用 undertow 代替 tomcat-->
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -58,8 +58,8 @@ public class TDEngineService {
config.setUsername(username);
config.setPassword(password);
config.setConnectionTestQuery("select server_status()");
config.setMinimumIdle(10); //minimum number of idle connection
config.setMaximumPoolSize(20); //maximum number of connection in the pool
config.setMinimumIdle(30); //minimum number of idle connection
config.setMaximumPoolSize(30); //maximum number of connection in the pool
config.setMaxLifetime(0); // maximum life time for each connection
// config.setIdleTimeout(0); // max idle time for recycle idle connection
log.info("=======>TDEngineUrl:" + config.getJdbcUrl());
@ -89,7 +89,7 @@ public class TDEngineService {
}
sb.append(") TAGS (`deviceid` BIGINT);");
try {
log.info(sb.toString());
log.debug(sb.toString());
pstmt.executeUpdate(sb.toString());
} catch (Exception e) {
log.error("创建超级表失败", e);
@ -111,7 +111,7 @@ public class TDEngineService {
sb.append(dataType);
sb.append(") TAGS (`deviceid` BIGINT);");
try {
log.info(sb.toString());
log.debug(sb.toString());
pstmt.executeUpdate(sb.toString());
} catch (Exception e) {
log.error("创建[计算量]超级表失败", e);

View File

@ -94,7 +94,10 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
@PostConstruct
public void init() {
//初始化高性能队列
int cpu = Runtime.getRuntime().availableProcessors();
int cpu = Runtime.getRuntime().availableProcessors() / 2;
if (cpu < 2) {
cpu = 2;
}
int bufferSize = 1024 * 4;
disruptor = new Disruptor<>(TerminalMessage::new, bufferSize, DaemonThreadFactory.INSTANCE, ProducerType.MULTI, new BlockingWaitStrategy());
//

View File

@ -96,11 +96,18 @@ calc:
task-name:
logging:
file:
name: /das/logs/das.log
level:
com:
das: DEBUG
das: INFO
tdengine:
password: taosdata
url: jdbc:TAOS-RS://192.168.109.187:6041/das
username: root
username: root
minio:
url: http://192.168.109.187:9000
bucket: das
accessKey: das
secretKey: zaq12WSX

View File

@ -96,6 +96,8 @@ das:
key: b6967ee87b86d85a
logging:
file:
name: /das/logs/das.log
level:
root: ERROR
com: