apache / apache/bookkeeper

[Bug] BookKeeper jar files contain log4j2 configuration files which is against Log4J recommendation

Open
#4,603 1 comment 1 reaction 0 assignees View on GitHub
type/bug
Dominant language
Java
Stars
2k
Forks
976
Avg merge
6d 15h
Merged PRs (30d)
7

Description

**BUG REPORT**

***Describe the bug***

When running some Pulsar tests in a module that didn't have a log4j2.xml config file, the logging configuration was picked up from the bookkeeper-server jar file although we have a log4j2.xml config file in a test module `buildtools` in Pulsar.

The bookkeeper-server jar contains `log4j2.xml` file, `bookkeeper-server/src/main/resources/log4j2.xml`.

In Log4j docs:
"If you are developing a library, only add configuration files to your test classpath."
https://logging.apache.org/log4j/2.x/manual/configuration.html#automatic-configuration

***Expected behavior***

Log4j2 config files should be removed from production jar files.

The bookkeeper-server jar contains `log4j2.xml` file, `bookkeeper-server/src/main/resources/log4j2.xml`. This should be removed from `src/main/resources` and if it's needed for tests, it should be placed in `src/test/resources`.
This might also apply to other modules in BookKeeper.

Contributor guide

Open the contributing guide

Research direction

Start with bookkeeper-server/src/main/resources/log4j2.xml and inspect the other BookKeeper modules for Log4j2 configuration files packaged in production resources. Check how the affected tests obtain their configuration, then verify that production jars no longer contain these files while test configuration remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.