Merge branch 'LOG4J2-3086' into master
diff --git a/README.md b/README.md
index 4197374..0a588b7 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,14 @@
Log4j 2 Core features require optional dependencies which are documented in the
[Log4j 2 manual](https://logging.apache.org/log4j/2.x/manual/index.html).
+The Kotlin API requires the full `kotlin-reflect` dependency in order to name loggers appropriately, and
+optionally `kotlinx-coroutines-core` to set the mapped diagnostic context for a coroutine.
+
+The Kotlin dependencies are not exposed transitively -- for maximum compatibility logging-log4j-kotlin is built
+with Kotlin 1.3, producing binaries that should be forward compatible. For maximum compat, the Kotlin dependencies
+are "provided" i.e. consumers of this library need to depend on them directly rather than transitively, thus
+avoiding version clashes.
+
## License
Apache Log4j 2 is distributed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
diff --git a/log4j-api-kotlin-benchmark/README.md b/log4j-api-kotlin-benchmark/README.md
index f13be59..17bb4dd 100644
--- a/log4j-api-kotlin-benchmark/README.md
+++ b/log4j-api-kotlin-benchmark/README.md
@@ -3,6 +3,6 @@
## Usage
```sh
-mvn install
+mvn package
java -jar log4j-api-kotlin-benchmark/target/benchmarks.jar
```
diff --git a/log4j-api-kotlin-benchmark/pom.xml b/log4j-api-kotlin-benchmark/pom.xml
index 07af174..7de5b87 100644
--- a/log4j-api-kotlin-benchmark/pom.xml
+++ b/log4j-api-kotlin-benchmark/pom.xml
@@ -42,6 +42,21 @@
<dependencies>
<dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib</artifactId>
+ <version>${kotlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-reflect</artifactId>
+ <version>${kotlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlinx</groupId>
+ <artifactId>kotlinx-coroutines-jdk8</artifactId>
+ <version>${kotlinx.coroutines.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api-kotlin</artifactId>
</dependency>
@@ -195,6 +210,10 @@
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.openjdk.jmh.Main</mainClass>
+ <manifestEntries>
+ <!-- Java 11 compat: https://stackoverflow.com/questions/52953483/logmanager-getlogger-is-unable-to-determine-class-name-on-java-11 -->
+ <Multi-Release>true</Multi-Release>
+ </manifestEntries>
</transformer>
</transformers>
<filters>
diff --git a/log4j-api-kotlin-sample/pom.xml b/log4j-api-kotlin-sample/pom.xml
index c1d2098..fddb7b7 100644
--- a/log4j-api-kotlin-sample/pom.xml
+++ b/log4j-api-kotlin-sample/pom.xml
@@ -37,6 +37,21 @@
<dependencies>
<dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib</artifactId>
+ <version>${kotlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-reflect</artifactId>
+ <version>${kotlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlinx</groupId>
+ <artifactId>kotlinx-coroutines-jdk8</artifactId>
+ <version>${kotlinx.coroutines.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api-kotlin</artifactId>
</dependency>
diff --git a/log4j-api-kotlin/pom.xml b/log4j-api-kotlin/pom.xml
index f887d6b..f042c86 100644
--- a/log4j-api-kotlin/pom.xml
+++ b/log4j-api-kotlin/pom.xml
@@ -43,16 +43,19 @@
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-jdk8</artifactId>
<version>${kotlinx.coroutines.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>