Browse Source

Pull request #4409: KERNEL-9862 fix: druid对接slf4j&&pom修复

Merge in CORE/base-third from ~DYLAN.LIU/base-third:feature/x to feature/x

* commit '7c4692dcefe9a6cc6fe2cbd6b1ca2568b881bc4d':
  KERNEL-9685 fix: log4j 版本升级
  KERNEL-9861 fix: pom修复
  KERNEL-9862 fix: druid对接slf4j
feature/x
Dylan.Liu 3 years ago
parent
commit
7c6170e2fe
  1. 188
      fine-druid/pom.xml
  2. 4
      fine-druid/src/main/java/com/fr/third/alibaba/druid/filter/logging/Slf4jLogFilter.java
  3. 4
      fine-druid/src/main/java/com/fr/third/alibaba/druid/support/logging/LogFactory.java
  4. 6
      fine-druid/src/main/java/com/fr/third/alibaba/druid/support/logging/SLF4JImpl.java
  5. 2
      fine-jboss-logging/pom.xml

188
fine-druid/pom.xml

@ -15,6 +15,11 @@
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>com.fr.essential</groupId>
<artifactId>fine-slf4j-api</artifactId>
<version>${essentialVersion}</version>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>fine-spring</artifactId>
@ -30,7 +35,7 @@
<artifactId>fine-javax-annotation</artifactId>
<version>${revision}</version>
</dependency>
<!-->以下是lib的本地jar包依赖<-->
<!-- 以下是lib的本地jar包依赖 -->
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>accessors-smart</artifactId>
@ -89,14 +94,14 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-apache-jsp-implementation</artifactId>
<artifactId>jetty-apache-jsp-implementation</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/apache-jsp-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>apache-::-jstl-module</artifactId>
<artifactId>apache-jstl-module</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/apache-jstl-9.3.20.v20170531.jar</systemPath>
@ -215,7 +220,7 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>bonecp-::-core-library</artifactId>
<artifactId>bonecp-core-library</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/bonecp-0.8.0.RELEASE.jar</systemPath>
@ -586,7 +591,7 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>guava:-google-core-libraries-for-java</artifactId>
<artifactId>guava-google-core-libraries-for-java</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/guava-30.1-jre.jar</systemPath>
@ -1132,7 +1137,7 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jax-rs-provider-for-json-content-type,-using-jackson-data-binding</artifactId>
<artifactId>jax-rs-provider-for-json-content-type-using-jackson-data-binding</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jackson-jaxrs-1.8.3.jar</systemPath>
@ -1214,69 +1219,6 @@
<scope>system</scope>
<systemPath>${basedir}/lib/java-xmlbuilder-0.4.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.annotation-api-1.2.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>expression-language-3.0</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.el-3.0.1-b12.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>javax.inject</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.inject-1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>javax.inject:1-as-osgi-bundle</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.inject-2.5.0-b32.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jdo-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.jdo-3.2.0-m3.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>java-servlet-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.servlet-api-3.1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jsp-implementation</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.servlet.jsp-2.3.2.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>javaserver-pages(tm)-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.servlet.jsp-api-2.3.1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/javax.ws.rs-api-2.0.1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>javolution</artifactId>
@ -1298,13 +1240,13 @@
<scope>system</scope>
<systemPath>${basedir}/lib/jaxb-impl-2.2.3-1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jcl-over-slf4j-1.7.21.jar</systemPath>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.fr.third</groupId>-->
<!-- <artifactId>jcl-over-slf4j</artifactId>-->
<!-- <version>local</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/jcl-over-slf4j-1.7.21.jar</systemPath>-->
<!-- </dependency>-->
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jcodings</artifactId>
@ -1426,63 +1368,63 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-servlet-annotations</artifactId>
<artifactId>jetty-servlet-annotations</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-annotations-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-asynchronous-http-client</artifactId>
<artifactId>jetty-asynchronous-http-client</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-client-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-http-utility</artifactId>
<artifactId>jetty-http-utility</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-http-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-io-utility</artifactId>
<artifactId>jetty-io-utility</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-io-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-jaas</artifactId>
<artifactId>jetty-jaas</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-jaas-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-jndi-naming</artifactId>
<artifactId>jetty-jndi-naming</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-jndi-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-plus</artifactId>
<artifactId>jetty-plus</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-plus-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-rewrite-handler</artifactId>
<artifactId>jetty-rewrite-handler</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-rewrite-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-runner</artifactId>
<artifactId>jetty-runner</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-runner-9.3.20.v20170531.jar</systemPath>
@ -1496,21 +1438,21 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-security</artifactId>
<artifactId>jetty-security</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-security-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-server-core</artifactId>
<artifactId>jetty-server-core</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-server-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-servlet-handling</artifactId>
<artifactId>jetty-servlet-handling</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-servlet-9.3.20.v20170531.jar</systemPath>
@ -1524,28 +1466,28 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-utilities</artifactId>
<artifactId>jetty-utilities</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-util-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-utilities-::-ajax(json)</artifactId>
<artifactId>jetty-utilities-ajax-json</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-util-ajax-9.3.19.v20170502.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-webapp-application-support</artifactId>
<artifactId>jetty-webapp-application-support</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-webapp-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-xml-utilities</artifactId>
<artifactId>jetty-xml-utilities</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jetty-xml-9.3.20.v20170531.jar</systemPath>
@ -1711,13 +1653,13 @@
<scope>system</scope>
<systemPath>${basedir}/lib/log4j-core-2.13.2.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>apache-log4j-slf4j-binding</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/log4j-slf4j-impl-2.10.0.jar</systemPath>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.fr.third</groupId>-->
<!-- <artifactId>apache-log4j-slf4j-binding</artifactId>-->
<!-- <version>local</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/log4j-slf4j-impl-2.10.0.jar</systemPath>-->
<!-- </dependency>-->
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>apache-log4j-web</artifactId>
@ -1790,7 +1732,7 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>oracle-corporation's-jdbc-and-xdevapi-driver-for-mysql</artifactId>
<artifactId>oracle-corporations-jdbc-and-xdevapi-driver-for-mysql</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/mysql-connector-java-8.0.21.jar</systemPath>
@ -1811,14 +1753,14 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>netty/buffer</artifactId>
<artifactId>netty-buffer</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/netty-buffer-4.1.17.Final.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>netty/common</artifactId>
<artifactId>netty-common</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/netty-common-4.1.17.Final.jar</systemPath>
@ -1909,7 +1851,7 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>osgi-resource-locator-bundle---used-by-various-api-providers-that-rely-on-meta-inf/services-mechanism-to-locate-providers.</artifactId>
<artifactId>osgi-resource-locator-bundle--used-by-various-api-providers-that-rely-on-meta-inf-services-mechanism-to-locate-providers</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/osgi-resource-locator-1.0.1.jar</systemPath>
@ -1937,7 +1879,7 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>protocol-buffers-[core]</artifactId>
<artifactId>protocol-buffers-core</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/protobuf-java-3.11.4.jar</systemPath>
@ -1977,20 +1919,20 @@
<scope>system</scope>
<systemPath>${basedir}/lib/sketches-core-0.9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>slf4j-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/slf4j-api-1.7.9.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/slf4j-log4j12-1.7.9.jar</systemPath>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.fr.third</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- <version>local</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/slf4j-api-1.7.9.jar</systemPath>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.fr.third</groupId>-->
<!-- <artifactId>slf4j-log4j12</artifactId>-->
<!-- <version>local</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/slf4j-log4j12-1.7.9.jar</systemPath>-->
<!-- </dependency>-->
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>snakeyaml</artifactId>
@ -2217,35 +2159,35 @@
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-websocket-::-api</artifactId>
<artifactId>jetty-websocket-api</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/websocket-api-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-websocket-::-client</artifactId>
<artifactId>jetty-websocket-client</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/websocket-client-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-websocket-::-common</artifactId>
<artifactId>jetty-websocket-common</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/websocket-common-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-websocket-::-server</artifactId>
<artifactId>jetty-websocket-server</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/websocket-server-9.3.20.v20170531.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr.third</groupId>
<artifactId>jetty-::-websocket-::-servlet-interface</artifactId>
<artifactId>jetty-websocket-servlet-interface</artifactId>
<version>local</version>
<scope>system</scope>
<systemPath>${basedir}/lib/websocket-servlet-9.3.20.v20170531.jar</systemPath>

4
fine-druid/src/main/java/com/fr/third/alibaba/druid/filter/logging/Slf4jLogFilter.java

@ -15,8 +15,8 @@
*/
package com.fr.third.alibaba.druid.filter.logging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fr.third.slf4j.Logger;
import com.fr.third.slf4j.LoggerFactory;
public class Slf4jLogFilter extends LogFilter {

4
fine-druid/src/main/java/com/fr/third/alibaba/druid/support/logging/LogFactory.java

@ -26,7 +26,7 @@ public class LogFactory {
String logType= System.getProperty("druid.logType");
if(logType != null){
if(logType.equalsIgnoreCase("slf4j")){
tryImplementation("org.slf4j.Logger", "SLF4JImpl");
tryImplementation("com.fr.third.slf4j.Logger", "SLF4JImpl");
}else if(logType.equalsIgnoreCase("log4j")){
tryImplementation("org.apache.log4j.Logger", "Log4jImpl");
}else if(logType.equalsIgnoreCase("log4j2")){
@ -38,13 +38,13 @@ public class LogFactory {
tryImplementation("java.util.logging.Logger", "Jdk14LoggingImpl");
}
}
tryImplementation("com.fr.third.slf4j.Logger", "SLF4JImpl");
// 优先选择log4j2防止漏洞
tryImplementation("com.fr.third.apache.logging.log4j.Logger", "FRLog4j2Impl");
// 优先选择log4j,而非Apache Common Logging. 因为后者无法设置真实Log调用者的信息
tryImplementation("com.fr.third.apache.log4j.Logger", "FRLog4jImpl");
tryImplementation("org.apache.log4j.Logger", "Log4jImpl");
tryImplementation("org.apache.logging.log4j.Logger", "Log4j2Impl");
tryImplementation("org.slf4j.Logger", "SLF4JImpl");
tryImplementation("org.apache.commons.logging.LogFactory", "JakartaCommonsLoggingImpl");
tryImplementation("java.util.logging.Logger", "Jdk14LoggingImpl");

6
fine-druid/src/main/java/com/fr/third/alibaba/druid/support/logging/SLF4JImpl.java

@ -15,9 +15,9 @@
*/
package com.fr.third.alibaba.druid.support.logging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.spi.LocationAwareLogger;
import com.fr.third.slf4j.Logger;
import com.fr.third.slf4j.LoggerFactory;
import com.fr.third.slf4j.spi.LocationAwareLogger;
public class SLF4JImpl implements Log {

2
fine-jboss-logging/pom.xml

@ -17,7 +17,7 @@
<dependencies>
<dependency>
<groupId>com.fr.essential</groupId>
<artifactId>fine-log4j</artifactId>
<artifactId>fine-log4j2</artifactId>
<version>${essentialVersion}</version>
</dependency>
<!-->以下是lib的本地jar包依赖<-->

Loading…
Cancel
Save