Skip to content

Commit 5660bbd

Browse files
committed
Merge branch '2.x' into dependabot/maven/log4j-to-slf4j/2.x/org.slf4j-slf4j-api-2.0.17
2 parents 8cefa09 + 34ced7c commit 5660bbd

File tree

65 files changed

+486
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+486
-128
lines changed

.asf.yaml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
# `.asf.yaml` is a branch-specific YAML configuration file for Git repositories to control features such as notifications, GitHub settings, etc.
19-
# See its documentation for details: https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
19+
# See its documentation for details: https://github.com/apache/infrastructure-asfyaml
2020

2121
# Bare minimum `notifications` to
2222
#
@@ -31,12 +31,15 @@ notifications:
3131
pullrequests: [email protected]
3232
pullrequests_bot_dependabot: [email protected]
3333
jira_options: link label worklog
34+
discussions: [email protected]
3435

3536
github:
3637
description: "Apache Log4j is a versatile, feature-rich, efficient logging API and backend for Java."
3738
homepage: https://logging.apache.org/log4j/2.x
3839
features:
3940
issues: true
41+
discussions: true
42+
projects: true
4043
del_branch_on_merge: true
4144
autolink_jira:
4245
- LOG4J2
@@ -60,8 +63,39 @@ github:
6063
merge: false
6164
rebase: false
6265

66+
# Enforce Review-then-Commit
6367
protected_branches:
64-
main:
65-
required_signatures: true
6668
2.x:
69+
# All commits must be signed
70+
required_signatures: true
71+
# All reviews must be addressed before merging
72+
required_conversation_resolution: true
73+
# Require checks to pass before merging
74+
required_status_checks:
75+
checks:
76+
# The GitHub Actions app: 15368
77+
- app_id: 15368
78+
context: "build / build (ubuntu-latest)"
79+
# The GitHub Advanced Security app: 57789
80+
- app_id: 57789
81+
context: "CodeQL"
82+
# At least one positive review must be present
83+
required_pull_request_reviews:
84+
required_approving_review_count: 1
85+
main:
86+
# All commits must be signed
6787
required_signatures: true
88+
# All reviews must be addressed before merging
89+
required_conversation_resolution: true
90+
# Require checks to pass before merging
91+
required_status_checks:
92+
checks:
93+
# The GitHub Actions app: 15368
94+
- app_id: 15368
95+
context: "build / build (ubuntu-latest)"
96+
# The GitHub Advanced Security app: 57789
97+
- app_id: 57789
98+
context: "CodeQL"
99+
# At least one positive review must be present
100+
required_pull_request_reviews:
101+
required_approving_review_count: 1

.cherry_picker.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
team = "apache"
19+
repo = "logging-log4j2"
20+
check_sha= "3da98f7c9de9bf4abb17e10dad678e05ab658a3a"
21+
fix_commit_msg = false
22+
default_branch = "2.x"
23+
require_version_in_branch_name=false
24+
draft_pr = true

.github/FUNDING.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
##
18+
# This file controls the "Sponsor" button in this repo.
19+
# For details see:
20+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
21+
#
22+
# WARNING: the `github` key accepts only 4 GitHub user ids, so we can not use this feature.
23+
#
24+
custom: "https://logging.apache.org/support.html#sponsors"
25+
tidelift: "maven/org.apache.logging.log4j:log4j-core"

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
build:
3232
if: github.actor != 'dependabot[bot]'
33-
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.0.0
33+
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.1.0
3434
secrets:
3535
DV_ACCESS_TOKEN: ${{ startsWith(github.ref_name, 'release/') && '' || secrets.DEVELOCITY_ACCESS_KEY }}
3636
with:
@@ -44,7 +44,7 @@ jobs:
4444
deploy-snapshot:
4545
needs: build
4646
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
47-
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/12.0.0
47+
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/12.1.0
4848
# Secrets for deployments
4949
secrets:
5050
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
@@ -57,7 +57,7 @@ jobs:
5757
deploy-release:
5858
needs: build
5959
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
60-
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/12.0.0
60+
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/12.1.0
6161
# Secrets for deployments
6262
secrets:
6363
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
@@ -78,7 +78,7 @@ jobs:
7878
needs: [ deploy-snapshot, deploy-release ]
7979
if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }}
8080
name: "verify-reproducibility (${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }})"
81-
uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@rel/12.0.0
81+
uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@rel/12.1.0
8282
with:
8383
nexus-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || 'https://repository.apache.org/content/groups/snapshots' }}
8484
# Encode the `runs-on` input as JSON array

.github/workflows/codeql-analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ permissions: read-all
3030
jobs:
3131

3232
analyze:
33-
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/12.0.0
33+
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/12.1.0
3434
with:
3535
java-version: |
3636
8

.github/workflows/deploy-site.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
deploy-site-stg:
3535
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
36-
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.0.0
36+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.0
3737
# Secrets for committing the generated site
3838
secrets:
3939
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
@@ -51,7 +51,7 @@ jobs:
5151

5252
deploy-site-pro:
5353
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x-site-pro'
54-
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.0.0
54+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.0
5555
# Secrets for committing the generated site
5656
secrets:
5757
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
@@ -81,7 +81,7 @@ jobs:
8181
8282
deploy-site-rel:
8383
needs: export-version
84-
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.0.0
84+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.0
8585
# Secrets for committing the generated site
8686
secrets:
8787
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}

.github/workflows/merge-dependabot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
build:
3232
if: github.repository == 'apache/logging-log4j2' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
33-
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.0.0
33+
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.1.0
3434
secrets:
3535
DV_ACCESS_TOKEN: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3636
with:
@@ -42,7 +42,7 @@ jobs:
4242

4343
merge-dependabot:
4444
needs: build
45-
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/12.0.0
45+
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/12.1.0
4646
with:
4747
java-version: 17
4848
permissions:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ felix-cache/
4040
node
4141
node_modules
4242
package-lock.json
43+
# Maven extensions
44+
/.mvn/extensions.xml

log4j-1.2-api/src/main/java/org/apache/log4j/Hierarchy.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.log4j;
1818

19+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
1920
import java.util.Enumeration;
2021
import java.util.Hashtable;
2122
import java.util.Vector;
@@ -79,10 +80,16 @@ protected Logger newLogger(final String name, final org.apache.logging.log4j.spi
7980
private static class PrivateLogManager extends org.apache.logging.log4j.LogManager {
8081
private static final String FQCN = Hierarchy.class.getName();
8182

83+
@SuppressFBWarnings(
84+
value = "HSM_HIDING_METHOD",
85+
justification = "The class is private, no confusion can arise.")
8286
public static LoggerContext getContext() {
8387
return getContext(FQCN, false);
8488
}
8589

90+
@SuppressFBWarnings(
91+
value = "HSM_HIDING_METHOD",
92+
justification = "The class is private, no confusion can arise.")
8693
public static org.apache.logging.log4j.Logger getLogger(final String name) {
8794
return getLogger(FQCN, name);
8895
}

log4j-1.2-api/src/main/java/org/apache/log4j/bridge/LogEventAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
public class LogEventAdapter extends LoggingEvent {
3939

40-
private static final long JVM_START_TIME = initStartTime();
40+
public static final long JVM_START_TIME = initStartTime();
4141

4242
private final LogEvent event;
4343

@@ -50,7 +50,7 @@ public LogEventAdapter(final LogEvent event) {
5050
* elapsed since 01.01.1970.
5151
* @return the time when the JVM started.
5252
*/
53-
public static long getStartTime() {
53+
public static long getJvmStartTime() {
5454
return JVM_START_TIME;
5555
}
5656

0 commit comments

Comments
 (0)