切换日志到log4j2
This commit is contained in:
parent
e2440a72b2
commit
e0f7f3cc43
10
das/pom.xml
10
das/pom.xml
@ -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>
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
//
|
||||
|
@ -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
|
||||
minio:
|
||||
url: http://192.168.109.187:9000
|
||||
bucket: das
|
||||
accessKey: das
|
||||
secretKey: zaq12WSX
|
@ -96,6 +96,8 @@ das:
|
||||
key: b6967ee87b86d85a
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: /das/logs/das.log
|
||||
level:
|
||||
root: ERROR
|
||||
com:
|
||||
|
Loading…
Reference in New Issue
Block a user