切换日志到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>
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-logging</artifactId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 使用log4j2代替logback-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- web 容器使用 undertow 代替 tomcat-->
|
<!-- web 容器使用 undertow 代替 tomcat-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -58,8 +58,8 @@ public class TDEngineService {
|
|||||||
config.setUsername(username);
|
config.setUsername(username);
|
||||||
config.setPassword(password);
|
config.setPassword(password);
|
||||||
config.setConnectionTestQuery("select server_status()");
|
config.setConnectionTestQuery("select server_status()");
|
||||||
config.setMinimumIdle(10); //minimum number of idle connection
|
config.setMinimumIdle(30); //minimum number of idle connection
|
||||||
config.setMaximumPoolSize(20); //maximum number of connection in the pool
|
config.setMaximumPoolSize(30); //maximum number of connection in the pool
|
||||||
config.setMaxLifetime(0); // maximum life time for each connection
|
config.setMaxLifetime(0); // maximum life time for each connection
|
||||||
// config.setIdleTimeout(0); // max idle time for recycle idle connection
|
// config.setIdleTimeout(0); // max idle time for recycle idle connection
|
||||||
log.info("=======>TDEngineUrl:" + config.getJdbcUrl());
|
log.info("=======>TDEngineUrl:" + config.getJdbcUrl());
|
||||||
@ -89,7 +89,7 @@ public class TDEngineService {
|
|||||||
}
|
}
|
||||||
sb.append(") TAGS (`deviceid` BIGINT);");
|
sb.append(") TAGS (`deviceid` BIGINT);");
|
||||||
try {
|
try {
|
||||||
log.info(sb.toString());
|
log.debug(sb.toString());
|
||||||
pstmt.executeUpdate(sb.toString());
|
pstmt.executeUpdate(sb.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("创建超级表失败", e);
|
log.error("创建超级表失败", e);
|
||||||
@ -111,7 +111,7 @@ public class TDEngineService {
|
|||||||
sb.append(dataType);
|
sb.append(dataType);
|
||||||
sb.append(") TAGS (`deviceid` BIGINT);");
|
sb.append(") TAGS (`deviceid` BIGINT);");
|
||||||
try {
|
try {
|
||||||
log.info(sb.toString());
|
log.debug(sb.toString());
|
||||||
pstmt.executeUpdate(sb.toString());
|
pstmt.executeUpdate(sb.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("创建[计算量]超级表失败", e);
|
log.error("创建[计算量]超级表失败", e);
|
||||||
|
@ -94,7 +94,10 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
//初始化高性能队列
|
//初始化高性能队列
|
||||||
int cpu = Runtime.getRuntime().availableProcessors();
|
int cpu = Runtime.getRuntime().availableProcessors() / 2;
|
||||||
|
if (cpu < 2) {
|
||||||
|
cpu = 2;
|
||||||
|
}
|
||||||
int bufferSize = 1024 * 4;
|
int bufferSize = 1024 * 4;
|
||||||
disruptor = new Disruptor<>(TerminalMessage::new, bufferSize, DaemonThreadFactory.INSTANCE, ProducerType.MULTI, new BlockingWaitStrategy());
|
disruptor = new Disruptor<>(TerminalMessage::new, bufferSize, DaemonThreadFactory.INSTANCE, ProducerType.MULTI, new BlockingWaitStrategy());
|
||||||
//
|
//
|
||||||
|
@ -96,11 +96,18 @@ calc:
|
|||||||
task-name:
|
task-name:
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
|
file:
|
||||||
|
name: /das/logs/das.log
|
||||||
level:
|
level:
|
||||||
com:
|
com:
|
||||||
das: DEBUG
|
das: INFO
|
||||||
|
|
||||||
tdengine:
|
tdengine:
|
||||||
password: taosdata
|
password: taosdata
|
||||||
url: jdbc:TAOS-RS://192.168.109.187:6041/das
|
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
|
@ -96,6 +96,8 @@ das:
|
|||||||
key: b6967ee87b86d85a
|
key: b6967ee87b86d85a
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
|
file:
|
||||||
|
name: /das/logs/das.log
|
||||||
level:
|
level:
|
||||||
root: ERROR
|
root: ERROR
|
||||||
com:
|
com:
|
||||||
|
Loading…
Reference in New Issue
Block a user