Skip to content

Removes bridges from Log4j 3 #2924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'apache/main' into feature/main/remove-b…
…ridges
  • Loading branch information
ppkarwasz committed Sep 30, 2024
commit f15fae661079da029c03d8fa6e635522c6f62bbc
14 changes: 7 additions & 7 deletions .github/generate-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ fail_for_invalid_args() {
# Constants
PROJECT_NAME="Apache Log4j"
PROJECT_ID="log4j"
PROJECT_SITE="https://logging.apache.org/log4j/3.x"
PROJECT_VERSION="$2"
PROJECT_SITE="https://logging.apache.org/$PROJECT_ID"
PROJECT_STAGING_SITE="${PROJECT_SITE/apache.org/staged.apache.org}"
PROJECT_REPO="https://github.com/apache/logging-log4j2"
PROJECT_VERSION="$2"
COMMIT_ID="$3"
PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION"

Expand All @@ -54,8 +54,8 @@ RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-site/antora/modules/ROOT/pag

dump_release_notes() {
awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE" \
| sed -r -e 's|'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]|#\2|g
s|https://github.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)\[(\1/\2#\4)\]|\5|g'
| sed -r -e 's!'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]!#\2!g
s!https://github.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)\[(\1/\2#\4)\]!\5!g'
}

case $1 in
Expand All @@ -67,13 +67,13 @@ Title: [VOTE] Release $PROJECT_NAME \`$PROJECT_VERSION\`

This is a vote to release the $PROJECT_NAME \`$PROJECT_VERSION\`.

Website: $PROJECT_STAGING_SITE-$PROJECT_VERSION
Website: $PROJECT_STAGING_SITE/$PROJECT_VERSION/index.html
GitHub: $PROJECT_REPO
Commit: $COMMIT_ID
Distribution: $PROJECT_DIST_URL
Nexus: https://repository.apache.org/content/repositories/orgapachelogging-<FIXME>
Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
Review kit: https://s.apache.org/logging-parent-release-review-kit
Review kit: https://logging.apache.org/logging-parent/release-review-instructions.html

Please download, test, and cast your votes on this mailing list.

Expand Down Expand Up @@ -103,7 +103,7 @@ and components to assist the deployment for various use cases.
For further information (support, download, etc.) see the project
website[1].

[1] $PROJECT_SITE
[1] $PROJECT_SITE/3.x/index.html

== Release Notes
EOF
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

build:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.3.0
secrets:
DV_ACCESS_TOKEN: ${{ ! startsWith(github.ref_name, 'release/') && secrets.GE_ACCESS_TOKEN }}
with:
Expand All @@ -41,7 +41,7 @@ jobs:
deploy-snapshot:
needs: build
if: github.repository == 'apache/logging-log4j2' && github.ref_name == 'main'
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/11.3.0
# Secrets for deployments
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
Expand All @@ -50,7 +50,7 @@ jobs:
deploy-release:
needs: build
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/11.3.0
# Secrets for deployments
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ permissions: read-all
jobs:

analyze:
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/11.3.0
with:
java-version: 17
# Permissions required to publish Security Alerts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

deploy-site-stg:
if: github.repository == 'apache/logging-log4j2' && github.ref_name == 'main'
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.3.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand All @@ -51,7 +51,7 @@ jobs:

deploy-site-pro:
if: github.repository == 'apache/logging-log4j2' && github.ref_name == 'main-site-pro'
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.3.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

deploy-site-rel:
needs: export-version
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.3.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/develocity-publish-build-scans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ jobs:
actions: write
pull-requests: write
steps:

- name: Setup Build Scan link capture
uses: gradle/develocity-actions/maven-setup@v1
uses: gradle/develocity-actions/maven-setup@9f1bf05334de7eb619731d5466c35a153742311d # 1.2

- name: Publish Build Scans
uses: gradle/develocity-actions/maven-publish-build-scan@v1
uses: gradle/develocity-actions/maven-publish-build-scan@9f1bf05334de7eb619731d5466c35a153742311d # 1.2
with:
develocity-url: 'https://ge.apache.org'
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/merge-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

build:
if: github.repository == 'apache/logging-log4j2' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.3.0
secrets:
DV_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
with:
Expand All @@ -39,7 +39,7 @@ jobs:

merge-dependabot:
needs: build
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/11.2.0
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/11.3.0
permissions:
contents: write # to push changelog commits
pull-requests: write # to close the PR
Expand Down
30 changes: 23 additions & 7 deletions BUILDING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ To remedy this, you can execute the following:
printf '127.0.0.1 %s\n::1 %s\n' `hostname` `hostname` | sudo tee -a /etc/hosts
----

[#docker]
=== Docker tests

Certain tests use Docker to spawn necessary external services.
Docker tests are configured using the `docker` Maven profile, which is activated by default for the CI environment.
You can locally enable this profile by passing a `-P docker` argument to your `./mvnw` commands.

[#website]
== Building the website

Expand Down Expand Up @@ -108,23 +115,32 @@ You can follow below steps for casual development needs:
./mvnw verify -DskipTests -pl :log4j-core,:log4j-core-test
----

[TIP]
====
[#development-ide-debug]
=== Debugging `./mvnw test` with IDE

You can connect your IDE to a `./mvnw test` run by

. Run `./mvnw test -pl :log4j-core-test -Dtest=FooBarTest -Dmaven.surefire.debug`
. Use _"Run > Attach to process"_ in IntelliJ IDEA
====

[#development-faq]
=== F.A.Q
[#development-ci]
=== Activating CI profiles

There are certain Maven profiles activated only for CI.
As a consequence of this, you can observe certain CI failures that you can't reproduce locally.
To work around this, you can activate CI profiles by running Maven commands as follows:

[source,bash]
----
CI=true ./mvnw ...
----

[#development-faq-idea-plugin-not-found]
==== Compilation in IntelliJ IDEA fails with `java: plug-in not found: ErrorProne`
=== Compilation in IntelliJ IDEA fails with `java: plug-in not found: ErrorProne`

Try removing all _"Override compiler parameters per-module"_ entries in _"Settings > Build, Execution, Deployment > Compiler > Java Compiler"_.

[#development-faq-idea-package-plugins]
==== Compilation in IntelliJ IDEA fails with `java: package org.apache.logging.log4j.plugins.test.validation.plugins does not exist`
=== Compilation in IntelliJ IDEA fails with `java: package org.apache.logging.log4j.plugins.test.validation.plugins does not exist`

We don't know how to fix this.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public void testSingleFilterInvocation() {
disruptor.start();
try {
config.log(FQCN, FQCN, null, Level.INFO, new SimpleMessage(), null);
verify(appender, timeout(100).times(1)).append(any());
// If this fails, the log event might not have reached the asynchronous thread yet
verify(appender, timeout(1000).times(1)).append(any());
verify(filter, times(1)).filter(any());
} finally {
disruptor.stop();
Expand Down
1 change: 1 addition & 0 deletions log4j-compress/.log4j-plugin-processing-activator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file is here to activate the `plugin-processing` Maven profile.
177 changes: 177 additions & 0 deletions log4j-compress/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to you under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>${revision}</version>
<relativePath>../log4j-parent</relativePath>
</parent>

<artifactId>log4j-compress</artifactId>
<name>Apache Log4j Core: Extended Compression Support</name>
<description>Add additional compression formats to Log4j Core.</description>

<properties>
<commons-compress.version>1.27.1</commons-compress.version>
<jimfs.version>1.3.0</jimfs.version>
<xz.version>1.10</xz.version>
<zstd.version>1.5.6-6</zstd.version>
</properties>

<dependencyManagement>
<dependencies>

<!-- Dummy dependency to force Dependabot to upgrade this entry -->
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>${xz.version}</version>
</dependency>

<!-- Dummy dependency to force Dependabot to upgrade this entry -->
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>${zstd.version}</version>
</dependency>

</dependencies>
</dependencyManagement>

<dependencies>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons-compress.version}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-plugins</artifactId>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
<version>${jimfs.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<configuration>
<excludes>
<exclude>org/apache/logging/log4j/compress/commons/xz/*</exclude>
<exclude>org/apache/logging/log4j/compress/commons/zstd/*</exclude>
</excludes>
</configuration>
</execution>
<!--
~ The XZ algorithm requires additional Commons Compress dependencies
-->
<execution>
<id>test-xz</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<additionalClasspathDependencies>
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>${xz.version}</version>
</dependency>
</additionalClasspathDependencies>
<includes>
<include>org/apache/logging/log4j/compress/commons/xz/*Test.class</include>
</includes>
</configuration>
</execution>
<!--
~ The XZ algorithm requires additional Commons Compress dependencies
-->
<execution>
<id>test-zstd</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<additionalClasspathDependencies>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>${zstd.version}</version>
</dependency>
</additionalClasspathDependencies>
<includes>
<include>org/apache/logging/log4j/compress/commons/zstd/*Test.class</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.