diff --git a/.gitignore b/.gitignore index 956f4e305..6915694fa 100644 --- a/.gitignore +++ b/.gitignore @@ -37,10 +37,10 @@ target/ *.tar.gz ### logs #### -logs +/logs/ +*.log ### temp ignore ### -*.log *.cache *.diff *.patch diff --git a/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml b/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..578b8c92e --- /dev/null +++ b/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + + + diff --git a/pigx-common/pigx-common-log/src/main/resources/META-INF/spring-devtools.properties b/pigx-common/pigx-common-log/src/main/resources/META-INF/spring-devtools.properties index 76296deab..db34a0283 100644 --- a/pigx-common/pigx-common-log/src/main/resources/META-INF/spring-devtools.properties +++ b/pigx-common/pigx-common-log/src/main/resources/META-INF/spring-devtools.properties @@ -1 +1 @@ -restart.include.pigx-common-security=/pigx-common-log[\\w-]+\.jar +restart.include.pigx-common-log=/pigx-common-log[\\w-]+\.jar diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/PigxFeignClientInterceptor.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/PigxFeignClientInterceptor.java index b93c3a925..1c011f0ab 100644 --- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/PigxFeignClientInterceptor.java +++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/PigxFeignClientInterceptor.java @@ -53,6 +53,10 @@ public class PigxFeignClientInterceptor extends OAuth2FeignRequestInterceptor { */ @Override public void apply(RequestTemplate template) { + if (template.headers().isEmpty()) { + return; + } + if (oAuth2ClientContext != null && oAuth2ClientContext.getAccessToken() != null) { super.apply(template); diff --git a/pigx-config/src/main/resources/logback-spring.xml b/pigx-config/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..578b8c92e --- /dev/null +++ b/pigx-config/src/main/resources/logback-spring.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + + + diff --git a/pigx-eureka/src/main/resources/logback-spring.xml b/pigx-eureka/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..578b8c92e --- /dev/null +++ b/pigx-eureka/src/main/resources/logback-spring.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 112133d74..2458b9c13 100644 --- a/pom.xml +++ b/pom.xml @@ -29,18 +29,11 @@ pom https://www.pig4cloud.com - - org.springframework.boot - spring-boot-starter-parent - 2.0.4.RELEASE - - - 1.6.2 2.0.4.RELEASE Finchley.SR1 - Cairo-SR2 + Cairo-SR3 UTF-8 1.8 1.8 @@ -121,6 +114,13 @@ + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + io.spring.platform platform-bom @@ -139,6 +139,7 @@ + ${project.name} @@ -151,7 +152,7 @@ - build-info + repackage @@ -181,8 +182,8 @@ maven-compiler-plugin - ${java.version} - ${java.version} + ${maven.compiler.target} + ${maven.compiler.source} UTF-8