Skip to content

Bump apache/logging-parent from rel/11.0.0 to 11.1.0 #2598

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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.0.0
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/11.1.0
# Secrets for deployments
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
Expand All @@ -56,7 +56,7 @@ jobs:
deploy-release:
needs: build
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/3')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/11.0.0
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/11.1.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.0.0
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/11.1.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.0.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.1.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.0.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.1.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.0.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.1.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/merge-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ 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.0.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.1.0

merge-dependabot:
needs: build
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/11.0.0
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/11.1.0
permissions:
contents: write # to push changelog commits
pull-requests: write # to close the PR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package org.apache.logging.log4j.core.impl;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.function.Supplier;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.async.AsyncQueueFullPolicy;
Expand Down Expand Up @@ -62,6 +62,7 @@
import org.apache.logging.log4j.spi.Provider;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.util.ServiceLoaderUtil;
import org.jspecify.annotations.Nullable;

/**
* Provides instance binding defaults.
Expand Down Expand Up @@ -103,24 +104,49 @@ public FlowMessageFactory defaultFlowMessageFactory() {

@SingletonFactory
@ConditionalOnMissingBinding
public RecyclerFactoryProvider defaultRecyclerFactoryProvider(
public RecyclerFactory defaultRecyclerFactory(
final PropertyEnvironment environment,
final ClassLoader loader,
final @Named("StatusLogger") org.apache.logging.log4j.Logger statusLogger) {
final String factory = environment.getProperty(RecyclerProperties.class).factory();
final Stream<RecyclerFactoryProvider> providerStream = ServiceLoaderUtil.safeStream(
RecyclerFactoryProvider.class, ServiceLoader.load(RecyclerFactoryProvider.class, loader), statusLogger);
final Optional<RecyclerFactoryProvider> provider = factory != null
? providerStream.filter(p -> factory.equals(p.getName())).findAny()
: providerStream.min(Comparator.comparing(RecyclerFactoryProvider::getOrder));
return provider.orElseGet(RecyclerFactoryProvider::getInstance);
}

@SingletonFactory
@ConditionalOnMissingBinding
public RecyclerFactory defaultRecyclerFactory(
final PropertyEnvironment environment, final RecyclerFactoryProvider provider) {
return provider.createForEnvironment(environment);
// Collect providers
@Nullable
final String providerName =
environment.getProperty(RecyclerProperties.class).factory();
final List<RecyclerFactoryProvider> providers = ServiceLoaderUtil.safeStream(
RecyclerFactoryProvider.class,
ServiceLoader.load(RecyclerFactoryProvider.class, loader),
statusLogger)
.sorted(Comparator.comparing(RecyclerFactoryProvider::getOrder))
.toList();
final String providerNames = providers.stream()
.map(provider -> "`" + provider.getName() + "`")
.collect(Collectors.joining(", "));

// Try to create the configured provider
if (providerName != null) {
@Nullable
final RecyclerFactoryProvider matchingProvider = providers.stream()
.filter(provider -> provider.getName().equals(providerName))
.findFirst()
.orElse(null);
if (matchingProvider != null) {
return matchingProvider.createForEnvironment(environment);
} else {
statusLogger.error(
"Configured recycler factory provider `{}` is not found! Available recycler factory providers: {}. Will choose the first one available for the current environment.",
providerName,
providerNames);
}
}

// Fallback to the first available provider
return providers.stream()
.map(provider -> provider.createForEnvironment(environment))
.findFirst()
.orElseThrow(() -> new IllegalStateException(
"None of the available recycler factory providers are found to be available for the current environment: "
+ providerNames));
}

@SingletonFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.logging.log4j.kit.recycler;

import edu.umd.cs.findbugs.annotations.Nullable;
import org.apache.logging.log4j.kit.env.PropertyEnvironment;
import org.apache.logging.log4j.kit.recycler.internal.DummyRecyclerFactoryProvider;

Expand Down Expand Up @@ -51,14 +50,9 @@ default int getOrder() {

/**
* Creates a recycler factory for the provided environment.
* <p>
* The return value can be null indicating that the recycler factory is not available for the provided environment.
* For instance, the provider of a {@link ThreadLocal}-based recycler factory can return null if the environment is of a web application.
* </p>
*
* @param environment an environment
* @return either a recycler factory instance, or null, if the associated recycler factory is not available for the given environment
* @return a recycler factory instance for the given environment
*/
@Nullable
RecyclerFactory createForEnvironment(PropertyEnvironment environment);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public String getName() {
@Override
public RecyclerFactory createForEnvironment(final PropertyEnvironment environment) {
requireNonNull(environment, "environment");

final int capacity = environment.getProperty(RecyclerProperties.class).capacity();
return new QueueingRecyclerFactory(capacity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ private RecyclerFactoryTestUtil() {}
if (capacity != null) {
properties.put("recycler.capacity", capacity.toString());
}
final PropertyEnvironment env = new TestPropertyEnvironment(properties);
final PropertyEnvironment environment = new TestPropertyEnvironment(properties);
return ServiceLoaderUtil.safeStream(
RecyclerFactoryProvider.class,
ServiceLoader.load(
RecyclerFactoryProvider.class, RecyclerFactoryTestUtil.class.getClassLoader()),
StatusLogger.getLogger())
.filter(p -> factory.equals(p.getName()))
.filter(factoryProvider -> factory.equals(factoryProvider.getName()))
.findFirst()
.map(p -> p.createForEnvironment(env))
.map(factoryProvider -> factoryProvider.createForEnvironment(environment))
.orElse(null);
}
}
2 changes: 1 addition & 1 deletion src/changelog/.3.x.x/update_apache_logging_parent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="2485" link="https://github.com/apache/logging-log4j2/pull/2485"/>
<issue id="2598" link="https://github.com/apache/logging-log4j2/pull/2598"/>
<description format="asciidoc">Update `apache/logging-parent` to version ``</description>
</entry>
1 change: 1 addition & 0 deletions src/site/antora/antora.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ asciidoc:
java-target-version: "${maven.compiler.target}"
java-compiler-version: "${minimalJavaBuildVersion}"
logging-services-url: "https://logging.apache.org"
lmax-disruptor-url: "https://lmax-exchange.github.io/disruptor"
# Dependency versions
commons-logging-version: "${site-commons-logging.version}"
log4j-api-version: "${log4j-api.version}"
Expand Down
1 change: 1 addition & 0 deletions src/site/antora/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ asciidoc:
java-target-version: "17"
java-compiler-version: "[17,18)"
logging-services-url: "https://logging.apache.org"
lmax-disruptor-url: "https://lmax-exchange.github.io/disruptor"
# Dependency versions
commons-logging-version: "1.4.0"
log4j-api-version: "1.2.3-api"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions src/site/antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
* xref:manual/layouts.adoc[]
** xref:manual/json-template-layout.adoc[]
* xref:manual/filters.adoc[]
* xref:manual/async.adoc[]
* xref:manual/garbagefree.adoc[]
* xref:manual/extending.adoc[]
* xref:manual/plugins.adoc[]
* xref:manual/customconfig.adoc[]
* xref:manual/customloglevels.adoc[]
* xref:manual/jmx.adoc[]
* xref:manual/logsep.adoc[]
* xref:manual/performance.adoc[]
** xref:manual/async.adoc[]
** xref:manual/garbagefree.adoc[]

.References
* xref:plugin-reference.adoc[Plugin reference]
Expand Down
Loading