Repository: logging-log4j2 Updated Branches: refs/heads/master ec5200a74 -> a73fce2e7
LOG4J2-2057 - Support new SLF4J binding mechanism introduced in SLF4J 1.8. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a73fce2e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a73fce2e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a73fce2e Branch: refs/heads/master Commit: a73fce2e726624efdd594f9b23f10ed253ac6884 Parents: ec5200a Author: Ralph Goers <[email protected]> Authored: Sun Sep 24 20:48:25 2017 -0700 Committer: Ralph Goers <[email protected]> Committed: Sun Sep 24 20:48:25 2017 -0700 ---------------------------------------------------------------------- log4j-slf4j-impl/pom.xml | 49 ++------------------ .../logging/slf4j/SLF4JServiceProvider.java | 41 ++++++++++++++++ .../services/org.slf4j.spi.SLF4JServiceProvider | 1 + src/changes/changes.xml | 3 ++ 4 files changed, 48 insertions(+), 46 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a73fce2e/log4j-slf4j-impl/pom.xml ---------------------------------------------------------------------- diff --git a/log4j-slf4j-impl/pom.xml b/log4j-slf4j-impl/pom.xml index ef8c5f0..299d5f7 100644 --- a/log4j-slf4j-impl/pom.xml +++ b/log4j-slf4j-impl/pom.xml @@ -31,15 +31,18 @@ <log4jParentDir>${basedir}/..</log4jParentDir> <docLabel>SLF4J Documentation</docLabel> <projectDir>/slf4j-impl</projectDir> + <slf4j.version>1.8.0-alpha2</slf4j.version> </properties> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-ext</artifactId> + <version>${slf4j.version}</version> <optional>true</optional> </dependency> <dependency> @@ -81,52 +84,6 @@ </dependencies> <build> <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludes> - <exclude>**/*Test.java</exclude> - </excludes> - </configuration> - <executions> - <execution> - <id>default-tests</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration> - <includes> - <include>**/*Test.java</include> - </includes> - <excludes> - <exclude>**/OptionalTest.java</exclude> - </excludes> - </configuration> - </execution> - <execution> - <id>test-optional</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration> - <excludes> - <exclude>**/LoggerTest.java</exclude> - <exclude>**/MarkerTest.java</exclude> - <exclude>**/SerializeTest.java</exclude> - </excludes> - <includes> - <include>**/OptionalTest.java</include> - </includes> - <classpathDependencyExcludes> - <classpathDependencyExcludes>org.slf4j:slf4j-ext</classpathDependencyExcludes> - </classpathDependencyExcludes> - </configuration> - </execution> - </executions> - </plugin> <!-- Include the standard NOTICE and LICENSE --> <plugin> <groupId>org.apache.maven.plugins</groupId> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a73fce2e/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JServiceProvider.java ---------------------------------------------------------------------- diff --git a/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JServiceProvider.java b/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JServiceProvider.java new file mode 100644 index 0000000..d6ca32a --- /dev/null +++ b/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JServiceProvider.java @@ -0,0 +1,41 @@ +package org.apache.logging.slf4j; + +import org.slf4j.ILoggerFactory; +import org.slf4j.IMarkerFactory; +import org.slf4j.spi.MDCAdapter; + +public class SLF4JServiceProvider implements org.slf4j.spi.SLF4JServiceProvider { + + public static final String REQUESTED_API_VERSION = "1.8.99"; + + private ILoggerFactory loggerFactory; + private IMarkerFactory markerFactory; + private MDCAdapter mdcAdapter; + + @Override + public ILoggerFactory getLoggerFactory() { + return loggerFactory; + } + + @Override + public IMarkerFactory getMarkerFactory() { + return markerFactory; + } + + @Override + public MDCAdapter getMDCAdapter() { + return mdcAdapter; + } + + @Override + public String getRequesteApiVersion() { + return REQUESTED_API_VERSION; + } + + @Override + public void initialize() { + loggerFactory = new Log4jLoggerFactory(); + markerFactory = new Log4jMarkerFactory(); + mdcAdapter = new Log4jMDCAdapter(); + } +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a73fce2e/log4j-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider ---------------------------------------------------------------------- diff --git a/log4j-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider b/log4j-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider new file mode 100644 index 0000000..1577f12 --- /dev/null +++ b/log4j-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider @@ -0,0 +1 @@ +org.apache.logging.slf4j.SLF4JServiceProvider \ No newline at end of file http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a73fce2e/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 4c69603..55b18f9 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> <release version="2.9.2" date="2017-XX-XX" description="GA Release 2.9.2"> + <action issue="LOG4J2-2057" dev="rgoers" type="update"> + Support new SLF4J binding mechanism introduced in SLF4J 1.8. + </action> <action issue="LOG4J2-2052" dev="rpopma" type="update"> Disable thread name caching by default when running on Java 8u102 or later. </action>
