add:日志

This commit is contained in:
zhangzq
2024-08-08 16:01:42 +08:00
parent bef29255a9
commit 9d91f7b095
13 changed files with 37 additions and 297 deletions

View File

@@ -463,12 +463,12 @@
<artifactId>lucene-queryparser</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>tlog-core</artifactId>
<version>1.5.0</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.yomahub</groupId>-->
<!-- <artifactId>tlog-core</artifactId>-->
<!-- <version>1.5.0</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
</dependencies>

View File

@@ -51,8 +51,6 @@ import java.util.Map;
@Slf4j
public class LogAspect {
/**
* 配置环绕通知,使用在方法logPointcut()上注册的切入点
*

View File

@@ -26,9 +26,6 @@ public class AsyncLuceneAppender extends AspectLogbackAsyncAppender {
}
MDC.clear();
}
}
public void appendSync(ILoggingEvent event){
super.append(event);
}
}

View File

@@ -68,7 +68,7 @@ public class LuceneAppender extends AppenderBase<ILoggingEvent> {
if (!map.isEmpty() && StringUtils.isNotEmpty(map.get("traceId"))){
doc.add(new StringField("traceId",map.get("traceId"), Field.Store.YES));
}else {
doc.add(new StringField("traceId", IdUtil.getStringId(), Field.Store.YES));
doc.add(new StringField("traceId", " ", Field.Store.YES));
}
doc.add(new TextField(LogMessageConstant.FIELD_MESSAGE, event.getFormattedMessage(), Field.Store.YES));

View File

@@ -1,17 +1,24 @@
package org.nl.config.mybatis;
import com.alibaba.druid.pool.DruidDataSource;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
@EnableTransactionManagement
@Configuration
public class MybatisPlusConfig {
@Autowired
private DataSource dataSource;
/**
* 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除)
添加自增插件
@@ -28,4 +35,10 @@ public class MybatisPlusConfig {
return interceptor;
}
@PostConstruct
public void datainnit() {
String url = ((DruidDataSource) dataSource).getUrl();
System.out.println("项目数据库地址:" + url);
}
}

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
//@Component
@RequiredArgsConstructor
@Order(100)
public class JobRunner implements ApplicationRunner {

View File

@@ -20,7 +20,7 @@ spring:
# 超时时间(以秒数为单位)
remove-abandoned-timeout: 180
# 获取连接超时时间
max-wait: 3000
max-wait: 9000
# 连接有效性检测时间
time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间
@@ -156,5 +156,5 @@ sa-token:
timeout: 10s
lucene:
index:
path: D:\lms\lucene\index
path: E:\lms\lucene\index

View File

@@ -112,6 +112,6 @@ mybatis-plus:
id-type: INPUT
lucene:
index:
path: D:\lms\lucene\index
path: E:\lms\lucene\index
tlog:
enable-invoke-time-print: true