diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a1639f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +lms/nladmin-system/nlsso-server/target/ +lms/nladmin-system/.idea/ +acs/nladmin-system/.idea/ +acs/nladmin-system/nlsso-server/target/ diff --git a/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml b/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml index 554aae8..e3eed7f 100644 --- a/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml +++ b/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml @@ -54,7 +54,7 @@ spring: multi-statement-allow: true flyway: # 是否启用flyway - enabled: true + enabled: false # 编码格式,默认UTF-8 encoding: UTF-8 # 迁移sql脚本文件存放路径,默认db/migration diff --git a/acs/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index 4f110ea..912e2e5 100644 --- a/acs/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -12,17 +12,15 @@ https://juejin.cn/post/6844903775631572999 nlAdmin + value="%cyan(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %cyan(%msg%n)"/> - + - @@ -30,7 +28,6 @@ https://juejin.cn/post/6844903775631572999 true - ${log.pattern} @@ -50,8 +47,7 @@ https://juejin.cn/post/6844903775631572999 20GB - - + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n @@ -59,7 +55,6 @@ https://juejin.cn/post/6844903775631572999 - 0 500 diff --git a/lms/nladmin-system/nlsso-server/pom.xml b/lms/nladmin-system/nlsso-server/pom.xml index 00f449c..c8a1c6d 100644 --- a/lms/nladmin-system/nlsso-server/pom.xml +++ b/lms/nladmin-system/nlsso-server/pom.xml @@ -33,11 +33,18 @@ + + + com.yomahub + tlog-web-spring-boot-starter + 1.5.0 + + org.fusesource.jansi jansi - 1.17.1 + 1.9 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java index 234c641..25611bc 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java @@ -2,11 +2,12 @@ package org.nl.system.service.quartz.utils; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; +import com.yomahub.tlog.task.quartz.TLogQuartzJobBean; import lombok.extern.slf4j.Slf4j; -import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.common.utils.RedisUtils; import org.nl.common.utils.ThrowableUtil; import org.nl.config.SpringContextHolder; +import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.system.service.quartz.ISysQuartzJobService; import org.nl.system.service.quartz.dao.SysQuartzJob; import org.nl.system.service.quartz.dao.SysQuartzLog; @@ -15,7 +16,6 @@ import org.nl.system.service.quartz.impl.SysQuartzJobServiceImpl; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.quartz.QuartzJobBean; import java.util.concurrent.Future; import java.util.concurrent.ThreadPoolExecutor; @@ -28,14 +28,14 @@ import java.util.concurrent.ThreadPoolExecutor; @Async @SuppressWarnings({"unchecked", "all"}) @Slf4j -public class ExecutionJob extends QuartzJobBean { +public class ExecutionJob extends TLogQuartzJobBean { /** * 该处仅供参考 */ private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll(); @Override - protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + public void executeTask(JobExecutionContext context) throws JobExecutionException { SysQuartzJob quartzJob = (SysQuartzJob) context.getMergedJobDataMap().get(SysQuartzJob.JOB_KEY); // 获取spring bean ISysQuartzJobService quartzJobService = SpringContextHolder.getBean(SysQuartzJobServiceImpl.class); @@ -99,4 +99,6 @@ public class ExecutionJob extends QuartzJobBean { } } + + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java index 4198696..cb7c5c8 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java @@ -1,19 +1,21 @@ package org.nl.system.service.quartz.utils; import cn.hutool.core.util.StrUtil; +import com.yomahub.tlog.core.thread.TLogInheritableTask; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.nl.config.SpringContextHolder; import org.springframework.util.ReflectionUtils; import java.lang.reflect.Method; -import java.util.concurrent.Callable; /** * 执行定时任务 + * * @author / */ @Slf4j -public class QuartzRunnable implements Callable { +public class QuartzRunnable extends TLogInheritableTask { private final Object target; private final Method method; @@ -31,14 +33,15 @@ public class QuartzRunnable implements Callable { } } + + @SneakyThrows @Override - public Object call() throws Exception { + public void runTask() { ReflectionUtils.makeAccessible(method); if (StrUtil.isNotEmpty(params)) { method.invoke(target, params); } else { method.invoke(target); } - return null; } } diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml index ac11b14..3206bf1 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -88,6 +88,10 @@ mybatis-plus: global-config: db-config: id-type: INPUT + banner: false lucene: index: path: D:\lucene\index +tlog: + enable-invoke-time-print: true + pattern: "[$preApp][$preIp][$spanId][$traceId]" \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index e1ccc79..f00f364 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -12,18 +12,18 @@ https://juejin.cn/post/6844903775631572999 nlAdmin + value="%cyan(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %cyan(%msg%n)"/> - - + + true + ${log.pattern} - ${log.charset} + @@ -49,7 +49,7 @@ https://juejin.cn/post/6844903775631572999 - + 0 500 @@ -57,7 +57,7 @@ https://juejin.cn/post/6844903775631572999 - +