Re: Sync `master` and `release-2.x` test structure
Hi, On Tue, 6 Sept 2022 at 22:40, Piotr P. Karwasz wrote: > What do you think about adding the `log4j-api-test` and > `log4j-core-test` modules also in `release-2.x`? This should limit the > number of conflicts to the differences that matter. It would be also nice to synchronise the `pom.xml` of `release-2.x` and `master`. Since the main `pom.xml` has about a hundred dependencies, what do you think about normalizing them by: * using BOMs if available (e.g. Jackson), * removing the scope from ``: this way there will be no difference between BOMs and explicit dependencies. It's more verbose, but we won't risk having JUnit in the compile scope. * removing exclusions from ``: AFAIK they are ignored by Maven. Or we can keep the exclusions as a template for the projects. * adding a property in the main pom.xml for *each* dependency used (e.g. even `slf4j-api:2.0.0` used in a single module). A convention on how to name these properties would be nice too... * sorting dependencies by scope (provided > compile > runtime > test), artifactId and groupId. Since POM style is as personal as code style, I would agree to all possible conventions as long as they are coherent. Piotr
Re: Sync `master` and `release-2.x` test structure
Totally agreed with all the points! I would like to extend this a bit more: * switch to CI-friendly versions via ${revision} * group properties by domain (e.g., common, lib versions, plugin versions) and lexicographically sort each group On Mon, Sep 12, 2022 at 9:11 AM Piotr P. Karwasz wrote: > Hi, > > On Tue, 6 Sept 2022 at 22:40, Piotr P. Karwasz > wrote: > > What do you think about adding the `log4j-api-test` and > > `log4j-core-test` modules also in `release-2.x`? This should limit the > > number of conflicts to the differences that matter. > > It would be also nice to synchronise the `pom.xml` of `release-2.x` > and `master`. Since the main `pom.xml` has about a hundred > dependencies, what do you think about normalizing them by: > > * using BOMs if available (e.g. Jackson), > * removing the scope from ``: this way there > will be no difference between BOMs and explicit dependencies. It's > more verbose, but we won't risk having JUnit in the compile scope. > * removing exclusions from ``: AFAIK they are > ignored by Maven. Or we can keep the exclusions as a template for the > projects. > * adding a property in the main pom.xml for *each* dependency used > (e.g. even `slf4j-api:2.0.0` used in a single module). A convention on > how to name these properties would be nice too... > * sorting dependencies by scope (provided > compile > runtime > > test), artifactId and groupId. > > Since POM style is as personal as code style, I would agree to all > possible conventions as long as they are coherent. > > Piotr >
Re: Sync `master` and `release-2.x` test structure
Hi Volkan, On Mon, 12 Sept 2022 at 11:53, Volkan Yazıcı wrote: > I would like to extend this a bit more: > > * switch to CI-friendly versions via ${revision} I am not sure, what do you mean by that: do we put ${revision} instead of the current Log4j2 version? Piotr
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
I'm not sure I understand, but the bottom line is I can't build the release from sources. Surely we can't say that disabling tests to validate or build a release is ok? Gary On Sun, Sep 11, 2022, 16:46 Matt Sicker wrote: > I get the same error when running on java 11, too, but that’s to be > expected. I wrote that test originally to explicitly detect the point at > which we’d have to do something about it, and we already addressed the > original issue long ago. In the 2.x branch, this is handled by using Maven > toolchains for switching from java 8. In the 3.x branch, this test was > updated to avoid referencing outdated internal APIs due to the base java > version requirements there. > > — > Matt Sicker > > > On Sep 11, 2022, at 16:01, Ron Grabowski wrote: > > > > I saw the same errors with JDK8 on Windows: > > > > openjdk version "1.8.0_342" > > OpenJDK Runtime Environment Corretto-8.342.07.3 (build 1.8.0_342-b07) > > OpenJDK 64-Bit Server VM Corretto-8.342.07.3 (build 25.342-b07, mixed > mode) > > > > [ERROR] Errors: > > [ERROR] > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 ▒ > IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 ▒ > IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > ▒ IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 ▒ > IndexOutOfBounds Index: 2, Size: 2 > > [INFO] > > [ERROR] Tests run: 2405, Failures: 0, Errors: 4, Skipped: 13 > > > > Different error with JDK11 on Windows: > > > > openjdk version "11.0.16.1" 2022-08-12 LTS > > OpenJDK Runtime Environment Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS) > > OpenJDK 64-Bit Server VM Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS, > mixed mode) > > > > [ERROR] > log4j-2.19.0-rc1\log4j-api\src\test\java\org\apache\logging\log4j\util\StackLocatorUtilTest.java:[31,18] > error: cannot find symbol > > [ERROR] symbol: class Reflection > > [ERROR] location: package sun.reflect > > > >> On 2022/09/11 16:12:51 Gary Gregory wrote: > >> I am away from home and my mac, so I am testing on Windows where I > always > >> get these failures: > >> > >> > >> [INFO] > >> [INFO] --- > >> [INFO] T E S T S > >> [INFO] --- > >> [INFO] Running org.apache.logging.log4j.core.layout.GelfLayoutTest > >> ERROR StatusLogger Recovering from > >> > StringBuilderEncoder.encode('{"version":"1.1","host":"US-L-GG02","timestamp":1662912585.090,"level":3,"_thread":"main","_logger":"","_Key1":"Value1","_Key2":"OpenJDK > >> Runtime Environment (build 1.8.0_342-b07) from > >> > Temurin","_MdcKey1":"MdcValue1","_MdcKey2":"MdcValue2","full_message":"java.lang.RuntimeException: > >> some error\r\n\tat > >> > org.apache.logging.log4j.core.layout.GelfLayoutTest.testCompressedLayout(GelfLayoutTest.java:135)\r\n\tat > >> > org.apache.logging.log4j.core.layout.GelfLayoutTest.testLayoutNoHost(GelfLayoutTest.java:276)\r\n\tat > > > > [snip] > > > >> > >> [INFO] > >> [INFO] Results: > >> [INFO] > >> [ERROR] Errors: > >> [ERROR] > >> GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 > » > >> IndexOutOfBounds Index: 2, Size: 2 > >> [ERROR] > >> GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 » > >> IndexOutOfBounds Index: 2, Size: 2 > >> [ERROR] GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > » > >> IndexOutOfBounds Index: 2, Size: 2 > >> [ERROR] > >> GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 » > >> IndexOutOfBounds Index: 2, Size: 2 > >> [INFO] > >> [ERROR] Tests run: 12, Failures: 0, Errors: 4, Skipped: 0 > >> [INFO] > >> [INFO] > >> > >> [INFO] BUILD FAILURE > >> [INFO] > >> > >> [INFO] Total time: 16.182 s > >> [INFO] Finished at: 2022-09-11T09:09:46-07:00 > >> [INFO] > >> > >> [ERROR] Failed to execute goal > >> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M6:test > (default-test) > >> on project log4j-core: > >> [ERROR] > >> [ERROR] Please refer to > >> C:\temp\apache-log4j-2.19.0-src\log4j-core\target\surefire-reports for > the > >> individual test results. > >> [ERROR] Please refer to dump files (if any exist) [date].dump, > >> [date]-jvmRun[N].dump and [date].dumpstream. > >> [ERROR] -> [Help 1] > >> [ERROR] > >> [ERROR] To see the full stack trace of the errors, re-run Maven with > the -e > >> switch. > >> [ERROR] Re-run Maven using the -X switch to enable full debug logging. > >> [ERROR] > >> [ERROR] For more information about the errors and possible solutions, > >> please read the following articles: > >> [ERROR] [Help 1] > >> http://
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
The sun.reflect test error is due to running Maven using Java 11. You'll need to run Maven using Java 8 (so that it's used as the default compiler for all the modules that don't override the toolchain to use) with Java 11 as a toolchain entry to compile the Java 9 and Java 11 modules. On Mon, Sep 12, 2022 at 9:05 AM Gary Gregory wrote: > > I'm not sure I understand, but the bottom line is I can't build the release > from sources. Surely we can't say that disabling tests to validate or build > a release is ok? > > Gary > > On Sun, Sep 11, 2022, 16:46 Matt Sicker wrote: > > > I get the same error when running on java 11, too, but that’s to be > > expected. I wrote that test originally to explicitly detect the point at > > which we’d have to do something about it, and we already addressed the > > original issue long ago. In the 2.x branch, this is handled by using Maven > > toolchains for switching from java 8. In the 3.x branch, this test was > > updated to avoid referencing outdated internal APIs due to the base java > > version requirements there. > > > > — > > Matt Sicker > > > > > On Sep 11, 2022, at 16:01, Ron Grabowski wrote: > > > > > > I saw the same errors with JDK8 on Windows: > > > > > > openjdk version "1.8.0_342" > > > OpenJDK Runtime Environment Corretto-8.342.07.3 (build 1.8.0_342-b07) > > > OpenJDK 64-Bit Server VM Corretto-8.342.07.3 (build 25.342-b07, mixed > > mode) > > > > > > [ERROR] Errors: > > > [ERROR] > > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 ▒ > > IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 ▒ > > IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > > ▒ IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 ▒ > > IndexOutOfBounds Index: 2, Size: 2 > > > [INFO] > > > [ERROR] Tests run: 2405, Failures: 0, Errors: 4, Skipped: 13 > > > > > > Different error with JDK11 on Windows: > > > > > > openjdk version "11.0.16.1" 2022-08-12 LTS > > > OpenJDK Runtime Environment Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS) > > > OpenJDK 64-Bit Server VM Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS, > > mixed mode) > > > > > > [ERROR] > > log4j-2.19.0-rc1\log4j-api\src\test\java\org\apache\logging\log4j\util\StackLocatorUtilTest.java:[31,18] > > error: cannot find symbol > > > [ERROR] symbol: class Reflection > > > [ERROR] location: package sun.reflect > > > > > >> On 2022/09/11 16:12:51 Gary Gregory wrote: > > >> I am away from home and my mac, so I am testing on Windows where I > > always > > >> get these failures: > > >> > > >> > > >> [INFO] > > >> [INFO] --- > > >> [INFO] T E S T S > > >> [INFO] --- > > >> [INFO] Running org.apache.logging.log4j.core.layout.GelfLayoutTest > > >> ERROR StatusLogger Recovering from > > >> > > StringBuilderEncoder.encode('{"version":"1.1","host":"US-L-GG02","timestamp":1662912585.090,"level":3,"_thread":"main","_logger":"","_Key1":"Value1","_Key2":"OpenJDK > > >> Runtime Environment (build 1.8.0_342-b07) from > > >> > > Temurin","_MdcKey1":"MdcValue1","_MdcKey2":"MdcValue2","full_message":"java.lang.RuntimeException: > > >> some error\r\n\tat > > >> > > org.apache.logging.log4j.core.layout.GelfLayoutTest.testCompressedLayout(GelfLayoutTest.java:135)\r\n\tat > > >> > > org.apache.logging.log4j.core.layout.GelfLayoutTest.testLayoutNoHost(GelfLayoutTest.java:276)\r\n\tat > > > > > > [snip] > > > > > >> > > >> [INFO] > > >> [INFO] Results: > > >> [INFO] > > >> [ERROR] Errors: > > >> [ERROR] > > >> GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 > > » > > >> IndexOutOfBounds Index: 2, Size: 2 > > >> [ERROR] > > >> GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 » > > >> IndexOutOfBounds Index: 2, Size: 2 > > >> [ERROR] GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > > » > > >> IndexOutOfBounds Index: 2, Size: 2 > > >> [ERROR] > > >> GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 » > > >> IndexOutOfBounds Index: 2, Size: 2 > > >> [INFO] > > >> [ERROR] Tests run: 12, Failures: 0, Errors: 4, Skipped: 0 > > >> [INFO] > > >> [INFO] > > >> > > >> [INFO] BUILD FAILURE > > >> [INFO] > > >> > > >> [INFO] Total time: 16.182 s > > >> [INFO] Finished at: 2022-09-11T09:09:46-07:00 > > >> [INFO] > > >> > > >> [ERROR] Failed to execute goal > > >> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M6:test > > (default-test) > > >> on project log4j-core: > > >> [ERROR] > > >> [ERROR] Please refer to > > >> C:\temp\apache-log4j-2.
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
I believe Matt is referring to the errors Ron saw when trying to only use Java 11. The errors you saw Gary would be an entirely different matter. Ralph > On Sep 12, 2022, at 8:41 AM, Matt Sicker wrote: > > The sun.reflect test error is due to running Maven using Java 11. > You'll need to run Maven using Java 8 (so that it's used as the > default compiler for all the modules that don't override the toolchain > to use) with Java 11 as a toolchain entry to compile the Java 9 and > Java 11 modules. > > On Mon, Sep 12, 2022 at 9:05 AM Gary Gregory wrote: >> >> I'm not sure I understand, but the bottom line is I can't build the release >> from sources. Surely we can't say that disabling tests to validate or build >> a release is ok? >> >> Gary >> >> On Sun, Sep 11, 2022, 16:46 Matt Sicker wrote: >> >>> I get the same error when running on java 11, too, but that’s to be >>> expected. I wrote that test originally to explicitly detect the point at >>> which we’d have to do something about it, and we already addressed the >>> original issue long ago. In the 2.x branch, this is handled by using Maven >>> toolchains for switching from java 8. In the 3.x branch, this test was >>> updated to avoid referencing outdated internal APIs due to the base java >>> version requirements there. >>> >>> — >>> Matt Sicker >>> On Sep 11, 2022, at 16:01, Ron Grabowski wrote: I saw the same errors with JDK8 on Windows: openjdk version "1.8.0_342" OpenJDK Runtime Environment Corretto-8.342.07.3 (build 1.8.0_342-b07) OpenJDK 64-Bit Server VM Corretto-8.342.07.3 (build 25.342-b07, mixed >>> mode) [ERROR] Errors: [ERROR] >>> GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 ▒ >>> IndexOutOfBounds Index: 2, Size: 2 [ERROR] >>> GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 ▒ >>> IndexOutOfBounds Index: 2, Size: 2 [ERROR] GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 >>> ▒ IndexOutOfBounds Index: 2, Size: 2 [ERROR] >>> GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 ▒ >>> IndexOutOfBounds Index: 2, Size: 2 [INFO] [ERROR] Tests run: 2405, Failures: 0, Errors: 4, Skipped: 13 Different error with JDK11 on Windows: openjdk version "11.0.16.1" 2022-08-12 LTS OpenJDK Runtime Environment Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS, >>> mixed mode) [ERROR] >>> log4j-2.19.0-rc1\log4j-api\src\test\java\org\apache\logging\log4j\util\StackLocatorUtilTest.java:[31,18] >>> error: cannot find symbol [ERROR] symbol: class Reflection [ERROR] location: package sun.reflect > On 2022/09/11 16:12:51 Gary Gregory wrote: > I am away from home and my mac, so I am testing on Windows where I >>> always > get these failures: > > > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running org.apache.logging.log4j.core.layout.GelfLayoutTest > ERROR StatusLogger Recovering from > >>> StringBuilderEncoder.encode('{"version":"1.1","host":"US-L-GG02","timestamp":1662912585.090,"level":3,"_thread":"main","_logger":"","_Key1":"Value1","_Key2":"OpenJDK > Runtime Environment (build 1.8.0_342-b07) from > >>> Temurin","_MdcKey1":"MdcValue1","_MdcKey2":"MdcValue2","full_message":"java.lang.RuntimeException: > some error\r\n\tat > >>> org.apache.logging.log4j.core.layout.GelfLayoutTest.testCompressedLayout(GelfLayoutTest.java:135)\r\n\tat > >>> org.apache.logging.log4j.core.layout.GelfLayoutTest.testLayoutNoHost(GelfLayoutTest.java:276)\r\n\tat [snip] > > [INFO] > [INFO] Results: > [INFO] > [ERROR] Errors: > [ERROR] > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 >>> » > IndexOutOfBounds Index: 2, Size: 2 > [ERROR] > GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 » > IndexOutOfBounds Index: 2, Size: 2 > [ERROR] GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 >>> » > IndexOutOfBounds Index: 2, Size: 2 > [ERROR] > GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 » > IndexOutOfBounds Index: 2, Size: 2 > [INFO] > [ERROR] Tests run: 12, Failures: 0, Errors: 4, Skipped: 0 > [INFO] > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 16.182 s > [INFO] Finished at: 2022-09-11T09:09:46-07:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.
Re: Sync `master` and `release-2.x` test structure
There's a neat plugin from the Jenkins project for making stable identifiers for CI builds that might be interesting: https://github.com/jenkinsci/incrementals-tools On Mon, Sep 12, 2022 at 7:49 AM Piotr P. Karwasz wrote: > > Hi Volkan, > > On Mon, 12 Sept 2022 at 11:53, Volkan Yazıcı wrote: > > I would like to extend this a bit more: > > > > * switch to CI-friendly versions via ${revision} > > I am not sure, what do you mean by that: do we put ${revision} instead > of the current Log4j2 version? > > Piotr
Re: Sync `master` and `release-2.x` test structure
See below. While I OK with reorganizing the parent pom.xml in release-2.x I am not OK with making radical changes to it since it is “stable”. I also think trying to synchronize the two is kind of pointless. Given that one is based on Java 8 and one is Java 11 and the organization of the projects is different there are going to be significant differences. > On Sep 12, 2022, at 12:11 AM, Piotr P. Karwasz > wrote: > > Hi, > > On Tue, 6 Sept 2022 at 22:40, Piotr P. Karwasz > wrote: >> What do you think about adding the `log4j-api-test` and >> `log4j-core-test` modules also in `release-2.x`? This should limit the >> number of conflicts to the differences that matter. > > It would be also nice to synchronise the `pom.xml` of `release-2.x` > and `master`. Since the main `pom.xml` has about a hundred > dependencies, what do you think about normalizing them by: > > * using BOMs if available (e.g. Jackson), I’m fine with this. > * removing the scope from ``: this way there > will be no difference between BOMs and explicit dependencies. It's > more verbose, but we won't risk having JUnit in the compile scope. I don’t understand. A BOM MUST be import to be included properly. Why wouldn’t you specify Junit as test scope since it always is, except for test modules that deliver a test jar. Those can be overriden. > * removing exclusions from ``: AFAIK they are > ignored by Maven. Or we can keep the exclusions as a template for the > projects. Are you sure this is true? I’m not sure it isn’t. > * adding a property in the main pom.xml for *each* dependency used > (e.g. even `slf4j-api:2.0.0` used in a single module). A convention on > how to name these properties would be nice too... I don’t understand this. A property to do what? > * sorting dependencies by scope (provided > compile > runtime > > test), artifactId and groupId. I’m fine with this. > > Since POM style is as personal as code style, I would agree to all > possible conventions as long as they are coherent. > > Piotr Ralph
Re: Sync `master` and `release-2.x` test structure
> On Sep 12, 2022, at 2:52 AM, Volkan Yazıcı wrote: > > Totally agreed with all the points! > > I would like to extend this a bit more: > > * switch to CI-friendly versions via ${revision} I don’t understand this. What is a “CI-friendly version”. What do you mean by ${revision}. Surely all dependencies can’t use the same version number. > * group properties by domain (e.g., common, lib versions, plugin versions) > and lexicographically sort each group I am all for making properties easy to find. However, just sorting them is probably enough. But I have no objection to grouping them. Ralph
Re: Sync `master` and `release-2.x` test structure
> On Sep 12, 2022, at 8:49 AM, Matt Sicker wrote: > > There's a neat plugin from the Jenkins project for making stable > identifiers for CI builds that might be interesting: > https://github.com/jenkinsci/incrementals-tools While that might be true, we don’t use Jenkins for our builds anymore. Instead, they all fail with GitHub actions instead of failing with Jenkins. Ralph
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
Check, I am using Java 8 (with a Maven toolchain obviously). Gary On Mon, Sep 12, 2022, 08:45 Ralph Goers wrote: > I believe Matt is referring to the errors Ron saw when trying to only use > Java 11. > The errors you saw Gary would be an entirely different matter. > > Ralph > > > On Sep 12, 2022, at 8:41 AM, Matt Sicker wrote: > > > > The sun.reflect test error is due to running Maven using Java 11. > > You'll need to run Maven using Java 8 (so that it's used as the > > default compiler for all the modules that don't override the toolchain > > to use) with Java 11 as a toolchain entry to compile the Java 9 and > > Java 11 modules. > > > > On Mon, Sep 12, 2022 at 9:05 AM Gary Gregory > wrote: > >> > >> I'm not sure I understand, but the bottom line is I can't build the > release > >> from sources. Surely we can't say that disabling tests to validate or > build > >> a release is ok? > >> > >> Gary > >> > >> On Sun, Sep 11, 2022, 16:46 Matt Sicker wrote: > >> > >>> I get the same error when running on java 11, too, but that’s to be > >>> expected. I wrote that test originally to explicitly detect the point > at > >>> which we’d have to do something about it, and we already addressed the > >>> original issue long ago. In the 2.x branch, this is handled by using > Maven > >>> toolchains for switching from java 8. In the 3.x branch, this test was > >>> updated to avoid referencing outdated internal APIs due to the base > java > >>> version requirements there. > >>> > >>> — > >>> Matt Sicker > >>> > On Sep 11, 2022, at 16:01, Ron Grabowski > wrote: > > I saw the same errors with JDK8 on Windows: > > openjdk version "1.8.0_342" > OpenJDK Runtime Environment Corretto-8.342.07.3 (build 1.8.0_342-b07) > OpenJDK 64-Bit Server VM Corretto-8.342.07.3 (build 25.342-b07, mixed > >>> mode) > > [ERROR] Errors: > [ERROR] > >>> > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 ▒ > >>> IndexOutOfBounds Index: 2, Size: 2 > [ERROR] > >>> GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 ▒ > >>> IndexOutOfBounds Index: 2, Size: 2 > [ERROR] > GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > >>> ▒ IndexOutOfBounds Index: 2, Size: 2 > [ERROR] > >>> GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 > ▒ > >>> IndexOutOfBounds Index: 2, Size: 2 > [INFO] > [ERROR] Tests run: 2405, Failures: 0, Errors: 4, Skipped: 13 > > Different error with JDK11 on Windows: > > openjdk version "11.0.16.1" 2022-08-12 LTS > OpenJDK Runtime Environment Corretto-11.0.16.9.1 (build > 11.0.16.1+9-LTS) > OpenJDK 64-Bit Server VM Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS, > >>> mixed mode) > > [ERROR] > >>> > log4j-2.19.0-rc1\log4j-api\src\test\java\org\apache\logging\log4j\util\StackLocatorUtilTest.java:[31,18] > >>> error: cannot find symbol > [ERROR] symbol: class Reflection > [ERROR] location: package sun.reflect > > > On 2022/09/11 16:12:51 Gary Gregory wrote: > > I am away from home and my mac, so I am testing on Windows where I > >>> always > > get these failures: > > > > > > [INFO] > > [INFO] --- > > [INFO] T E S T S > > [INFO] --- > > [INFO] Running org.apache.logging.log4j.core.layout.GelfLayoutTest > > ERROR StatusLogger Recovering from > > > >>> > StringBuilderEncoder.encode('{"version":"1.1","host":"US-L-GG02","timestamp":1662912585.090,"level":3,"_thread":"main","_logger":"","_Key1":"Value1","_Key2":"OpenJDK > > Runtime Environment (build 1.8.0_342-b07) from > > > >>> > Temurin","_MdcKey1":"MdcValue1","_MdcKey2":"MdcValue2","full_message":"java.lang.RuntimeException: > > some error\r\n\tat > > > >>> > org.apache.logging.log4j.core.layout.GelfLayoutTest.testCompressedLayout(GelfLayoutTest.java:135)\r\n\tat > > > >>> > org.apache.logging.log4j.core.layout.GelfLayoutTest.testLayoutNoHost(GelfLayoutTest.java:276)\r\n\tat > > [snip] > > > > > [INFO] > > [INFO] Results: > > [INFO] > > [ERROR] Errors: > > [ERROR] > > > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 > >>> » > > IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > > GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 > » > > IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > >>> » > > IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > > > GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 » > > IndexOutOfBounds Index: 2, Size: 2 > > [INFO] > > [ERROR] Tests run: 12, Failures: 0, Errors: 4, Skipped: 0 > > [INFO] > > [INFO] > > > ---
Re: Sync `master` and `release-2.x` test structure
You can find more about CI-friendly versioning and ${revision} here: https://maven.apache.org/maven-ci-friendly.html In a nutshell, you only define the `revision` property in the parent POM's `` block and refer to it everywhere you need to literally type the version. On Mon, Sep 12, 2022 at 2:49 PM Piotr P. Karwasz wrote: > Hi Volkan, > > On Mon, 12 Sept 2022 at 11:53, Volkan Yazıcı wrote: > > I would like to extend this a bit more: > > > > * switch to CI-friendly versions via ${revision} > > I am not sure, what do you mean by that: do we put ${revision} instead > of the current Log4j2 version? > > Piotr >
Re: Sync `master` and `release-2.x` test structure
Hi, On Mon, 12 Sept 2022 at 18:05, Ralph Goers wrote: > See below. While I OK with reorganizing the parent pom.xml in release-2.x I > am not > OK with making radical changes to it since it is “stable”. I also think > trying to synchronize > the two is kind of pointless. Given that one is based on Java 8 and one is > Java 11 > and the organization of the projects is different there are going to be > significant differences. I don't plan any radical changes, I would just like a similar structure to easily compare the dependencies of the two branches. Of course `master` can have newer dependency versions, but it can not have older dependencies than `release-2.x`. > > * removing the scope from ``: this way there > > will be no difference between BOMs and explicit dependencies. It's > > more verbose, but we won't risk having JUnit in the compile scope. > > I don’t understand. A BOM MUST be import to be included > properly. > Why wouldn’t you specify Junit as test scope since it always is, except for > test modules > that deliver a test jar. Those can be overriden. The problem with BOMs is that they import dependencies in the default scope. If we use `junit-bom`, we need to specify the `test` scope of JUnit libraries in all children POMs, while we don't need to do it with `hamcrest-core` that does not have a BOM. What I propose is to *always* specify the scope in children POMs, even if it is inherited from . > > * removing exclusions from ``: AFAIK they are > > ignored by Maven. Or we can keep the exclusions as a template for the > > projects. > > Are you sure this is true? I’m not sure it isn’t. I stand corrected. Regardless of what StackOverflow says, exclusions in the seem to work (since version 2.0 :-) ) Piotr
Re: Sync `master` and `release-2.x` test structure
On Mon, Sep 12, 2022 at 11:10 AM Ralph Goers wrote: > While that might be true, we don’t use Jenkins for our builds anymore. > Instead, they all fail with GitHub actions instead of failing with Jenkins. It's a Maven plugin.
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
Are you getting any other test failures besides the GelfLayoutTest one? On Mon, Sep 12, 2022 at 11:24 AM Gary Gregory wrote: > > Check, I am using Java 8 (with a Maven toolchain obviously). > > Gary > > On Mon, Sep 12, 2022, 08:45 Ralph Goers wrote: > > > I believe Matt is referring to the errors Ron saw when trying to only use > > Java 11. > > The errors you saw Gary would be an entirely different matter. > > > > Ralph > > > > > On Sep 12, 2022, at 8:41 AM, Matt Sicker wrote: > > > > > > The sun.reflect test error is due to running Maven using Java 11. > > > You'll need to run Maven using Java 8 (so that it's used as the > > > default compiler for all the modules that don't override the toolchain > > > to use) with Java 11 as a toolchain entry to compile the Java 9 and > > > Java 11 modules. > > > > > > On Mon, Sep 12, 2022 at 9:05 AM Gary Gregory > > wrote: > > >> > > >> I'm not sure I understand, but the bottom line is I can't build the > > release > > >> from sources. Surely we can't say that disabling tests to validate or > > build > > >> a release is ok? > > >> > > >> Gary > > >> > > >> On Sun, Sep 11, 2022, 16:46 Matt Sicker wrote: > > >> > > >>> I get the same error when running on java 11, too, but that’s to be > > >>> expected. I wrote that test originally to explicitly detect the point > > at > > >>> which we’d have to do something about it, and we already addressed the > > >>> original issue long ago. In the 2.x branch, this is handled by using > > Maven > > >>> toolchains for switching from java 8. In the 3.x branch, this test was > > >>> updated to avoid referencing outdated internal APIs due to the base > > java > > >>> version requirements there. > > >>> > > >>> — > > >>> Matt Sicker > > >>> > > On Sep 11, 2022, at 16:01, Ron Grabowski > > wrote: > > > > I saw the same errors with JDK8 on Windows: > > > > openjdk version "1.8.0_342" > > OpenJDK Runtime Environment Corretto-8.342.07.3 (build 1.8.0_342-b07) > > OpenJDK 64-Bit Server VM Corretto-8.342.07.3 (build 25.342-b07, mixed > > >>> mode) > > > > [ERROR] Errors: > > [ERROR] > > >>> > > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 ▒ > > >>> IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > > >>> GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 ▒ > > >>> IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > > GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > > >>> ▒ IndexOutOfBounds Index: 2, Size: 2 > > [ERROR] > > >>> GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 > > ▒ > > >>> IndexOutOfBounds Index: 2, Size: 2 > > [INFO] > > [ERROR] Tests run: 2405, Failures: 0, Errors: 4, Skipped: 13 > > > > Different error with JDK11 on Windows: > > > > openjdk version "11.0.16.1" 2022-08-12 LTS > > OpenJDK Runtime Environment Corretto-11.0.16.9.1 (build > > 11.0.16.1+9-LTS) > > OpenJDK 64-Bit Server VM Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS, > > >>> mixed mode) > > > > [ERROR] > > >>> > > log4j-2.19.0-rc1\log4j-api\src\test\java\org\apache\logging\log4j\util\StackLocatorUtilTest.java:[31,18] > > >>> error: cannot find symbol > > [ERROR] symbol: class Reflection > > [ERROR] location: package sun.reflect > > > > > On 2022/09/11 16:12:51 Gary Gregory wrote: > > > I am away from home and my mac, so I am testing on Windows where I > > >>> always > > > get these failures: > > > > > > > > > [INFO] > > > [INFO] --- > > > [INFO] T E S T S > > > [INFO] --- > > > [INFO] Running org.apache.logging.log4j.core.layout.GelfLayoutTest > > > ERROR StatusLogger Recovering from > > > > > >>> > > StringBuilderEncoder.encode('{"version":"1.1","host":"US-L-GG02","timestamp":1662912585.090,"level":3,"_thread":"main","_logger":"","_Key1":"Value1","_Key2":"OpenJDK > > > Runtime Environment (build 1.8.0_342-b07) from > > > > > >>> > > Temurin","_MdcKey1":"MdcValue1","_MdcKey2":"MdcValue2","full_message":"java.lang.RuntimeException: > > > some error\r\n\tat > > > > > >>> > > org.apache.logging.log4j.core.layout.GelfLayoutTest.testCompressedLayout(GelfLayoutTest.java:135)\r\n\tat > > > > > >>> > > org.apache.logging.log4j.core.layout.GelfLayoutTest.testLayoutNoHost(GelfLayoutTest.java:276)\r\n\tat > > > > [snip] > > > > > > > > [INFO] > > > [INFO] Results: > > > [INFO] > > > [ERROR] Errors: > > > [ERROR] > > > > > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 > > >>> » > > > IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > > GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 > > » > > > IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > GelfLayoutTest.testLayoutNoHost:276
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
Hi Ralph, On Sat, 10 Sept 2022 at 00:56, Ralph Goers wrote: > Maven Artifacts: > https://repository.apache.org/content/repositories/orgapachelogging-1088/ I think I left a big bug in log4j-slf4j2-impl/pom.xml: the JUnit artifacts are in the compile scope. Piotr
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
Wonderful. That really needs to be fixed so this vote will have to be cancelled. Also, can someone fix the test Gary is having a problem with? Ralph > On Sep 12, 2022, at 2:20 PM, Piotr P. Karwasz wrote: > > Hi Ralph, > > On Sat, 10 Sept 2022 at 00:56, Ralph Goers wrote: >> Maven Artifacts: >> https://repository.apache.org/content/repositories/orgapachelogging-1088/ > > I think I left a big bug in log4j-slf4j2-impl/pom.xml: the JUnit > artifacts are in the compile scope. > > Piotr
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
I did get other errors in core but they are intermittent so I only want to figure out what is the problem with these since they happen every time. Gary On Mon, Sep 12, 2022, 13:26 Matt Sicker wrote: > Are you getting any other test failures besides the GelfLayoutTest one? > > On Mon, Sep 12, 2022 at 11:24 AM Gary Gregory > wrote: > > > > Check, I am using Java 8 (with a Maven toolchain obviously). > > > > Gary > > > > On Mon, Sep 12, 2022, 08:45 Ralph Goers > wrote: > > > > > I believe Matt is referring to the errors Ron saw when trying to only > use > > > Java 11. > > > The errors you saw Gary would be an entirely different matter. > > > > > > Ralph > > > > > > > On Sep 12, 2022, at 8:41 AM, Matt Sicker wrote: > > > > > > > > The sun.reflect test error is due to running Maven using Java 11. > > > > You'll need to run Maven using Java 8 (so that it's used as the > > > > default compiler for all the modules that don't override the > toolchain > > > > to use) with Java 11 as a toolchain entry to compile the Java 9 and > > > > Java 11 modules. > > > > > > > > On Mon, Sep 12, 2022 at 9:05 AM Gary Gregory > > > > wrote: > > > >> > > > >> I'm not sure I understand, but the bottom line is I can't build the > > > release > > > >> from sources. Surely we can't say that disabling tests to validate > or > > > build > > > >> a release is ok? > > > >> > > > >> Gary > > > >> > > > >> On Sun, Sep 11, 2022, 16:46 Matt Sicker wrote: > > > >> > > > >>> I get the same error when running on java 11, too, but that’s to be > > > >>> expected. I wrote that test originally to explicitly detect the > point > > > at > > > >>> which we’d have to do something about it, and we already addressed > the > > > >>> original issue long ago. In the 2.x branch, this is handled by > using > > > Maven > > > >>> toolchains for switching from java 8. In the 3.x branch, this test > was > > > >>> updated to avoid referencing outdated internal APIs due to the base > > > java > > > >>> version requirements there. > > > >>> > > > >>> — > > > >>> Matt Sicker > > > >>> > > > On Sep 11, 2022, at 16:01, Ron Grabowski > > > wrote: > > > > > > I saw the same errors with JDK8 on Windows: > > > > > > openjdk version "1.8.0_342" > > > OpenJDK Runtime Environment Corretto-8.342.07.3 (build > 1.8.0_342-b07) > > > OpenJDK 64-Bit Server VM Corretto-8.342.07.3 (build 25.342-b07, > mixed > > > >>> mode) > > > > > > [ERROR] Errors: > > > [ERROR] > > > >>> > > > > GelfLayoutTest.testLayoutNewLineDelimiter:286->testCompressedLayout:189 ▒ > > > >>> IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > > >>> > GelfLayoutTest.testLayoutNoCompression:256->testCompressedLayout:189 ▒ > > > >>> IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > > GelfLayoutTest.testLayoutNoHost:276->testCompressedLayout:189 > > > >>> ▒ IndexOutOfBounds Index: 2, Size: 2 > > > [ERROR] > > > >>> > GelfLayoutTest.testLayoutNoThreadContext:271->testCompressedLayout:189 > > > ▒ > > > >>> IndexOutOfBounds Index: 2, Size: 2 > > > [INFO] > > > [ERROR] Tests run: 2405, Failures: 0, Errors: 4, Skipped: 13 > > > > > > Different error with JDK11 on Windows: > > > > > > openjdk version "11.0.16.1" 2022-08-12 LTS > > > OpenJDK Runtime Environment Corretto-11.0.16.9.1 (build > > > 11.0.16.1+9-LTS) > > > OpenJDK 64-Bit Server VM Corretto-11.0.16.9.1 (build > 11.0.16.1+9-LTS, > > > >>> mixed mode) > > > > > > [ERROR] > > > >>> > > > > log4j-2.19.0-rc1\log4j-api\src\test\java\org\apache\logging\log4j\util\StackLocatorUtilTest.java:[31,18] > > > >>> error: cannot find symbol > > > [ERROR] symbol: class Reflection > > > [ERROR] location: package sun.reflect > > > > > > > On 2022/09/11 16:12:51 Gary Gregory wrote: > > > > I am away from home and my mac, so I am testing on Windows where > I > > > >>> always > > > > get these failures: > > > > > > > > > > > > [INFO] > > > > [INFO] --- > > > > [INFO] T E S T S > > > > [INFO] --- > > > > [INFO] Running > org.apache.logging.log4j.core.layout.GelfLayoutTest > > > > ERROR StatusLogger Recovering from > > > > > > > >>> > > > > StringBuilderEncoder.encode('{"version":"1.1","host":"US-L-GG02","timestamp":1662912585.090,"level":3,"_thread":"main","_logger":"","_Key1":"Value1","_Key2":"OpenJDK > > > > Runtime Environment (build 1.8.0_342-b07) from > > > > > > > >>> > > > > Temurin","_MdcKey1":"MdcValue1","_MdcKey2":"MdcValue2","full_message":"java.lang.RuntimeException: > > > > some error\r\n\tat > > > > > > > >>> > > > > org.apache.logging.log4j.core.layout.GelfLayoutTest.testCompressedLayout(GelfLayoutTest.java:135)\r\n\tat > > > > > > > >>> > > > > org.apache.logging.log4j.core.layout.GelfLayoutTest.testLayoutNoHost(GelfLayoutTest.java:276)\r\n\tat > > > >
Re: [VOTE] Release Apache Log4j 2.19.0-rc1
Hi Gary, On Tue, 13 Sept 2022 at 00:05, Gary Gregory wrote: > > I did get other errors in core but they are intermittent so I only want to > figure out what is the problem with these since they happen every time. The culprit might be the `json-unit` bump I performed: https://github.com/apache/logging-log4j2/commit/e88b4c7a82c22ea8f346e85614f52d99a3186cf1 I don't know how is it linked with the `ArrayIndexOutOfBoundsException` (since this simply means we get less log messages than expected), but you can try reverting it. Piotr
Re: Nasty surprise in 2.18.0
Hi Piotr, I see in the release notes that the fix made it in 2.19.0 RC1, thank you! Gary On Thu, Jul 21, 2022, 17:33 Gary Gregory wrote: > Hi Piotr, > > Thank you so much for the quick analysis! > > Gary > > > On Thu, Jul 21, 2022, 17:35 Piotr P. Karwasz > wrote: > >> Hi Gary, >> >> > The script that starts our app uses an environment variable called >> > LOG4J and starting with 2.18.0, Log4j puts the content of this >> > environment variable in ALL system properties. >> > >> > Thoughts? >> >> Sorry, I must have broken it while fixing LOG4J-3413. The >> ConsoleAppender is actually calling >> PropertiesUtil.getCharsetProperty("sun.stdout.encoding") and: >> >> * it looks up a literal environment/system property >> "sun.stdout.encoding" and finds nothing, >> * it tokenizes "sun.stdout.encoding" and obtains an empty list of >> tokens (this should prevent "configurationFile" to be confused with >> "log4j2.configurationFile"), >> * it normalizes the empty list of tokens and looks up a Java system >> property named "log4j2" and an environment variable named "LOG4J". >> >> I'll fix it tomorrow and add a test. >> >> Piotr >> >
Re: Nasty surprise in 2.18.0
Unfortunately, I cancelled the vote for that. I need fixes for 1. SLF4J2 support to make the Junit dependency test scope. 2. Fix GelfLayoutTest on Windows. If someone can let me know when these are fixed I will create a new release candidate. Ralph > On Sep 12, 2022, at 5:01 PM, Gary Gregory wrote: > > Hi Piotr, > > I see in the release notes that the fix made it in 2.19.0 RC1, thank you! > > Gary > > On Thu, Jul 21, 2022, 17:33 Gary Gregory wrote: > >> Hi Piotr, >> >> Thank you so much for the quick analysis! >> >> Gary >> >> >> On Thu, Jul 21, 2022, 17:35 Piotr P. Karwasz >> wrote: >> >>> Hi Gary, >>> The script that starts our app uses an environment variable called LOG4J and starting with 2.18.0, Log4j puts the content of this environment variable in ALL system properties. Thoughts? >>> >>> Sorry, I must have broken it while fixing LOG4J-3413. The >>> ConsoleAppender is actually calling >>> PropertiesUtil.getCharsetProperty("sun.stdout.encoding") and: >>> >>> * it looks up a literal environment/system property >>> "sun.stdout.encoding" and finds nothing, >>> * it tokenizes "sun.stdout.encoding" and obtains an empty list of >>> tokens (this should prevent "configurationFile" to be confused with >>> "log4j2.configurationFile"), >>> * it normalizes the empty list of tokens and looks up a Java system >>> property named "log4j2" and an environment variable named "LOG4J". >>> >>> I'll fix it tomorrow and add a test. >>> >>> Piotr >>> >>
Re: Nasty surprise in 2.18.0
On Tue, 13 Sept 2022 at 02:24, Ralph Goers wrote: > 1. SLF4J2 support to make the Junit dependency test scope. I fixed it yesterday, but if someone else can do a `mvn dependency:list -DincludeScope=runtime` and look for dependencies that should not be there, it would be better. > 2. Fix GelfLayoutTest on Windows. It disappeared on my Windows box after increasing the `EncodingListAppender` buffer size to 16 KiB. I committed the fix. Piotr