Re: [D] [ERROR] class file for org.apache.logging .log4j.Logger not found [logging-log4j2]

ppkarwasz (via GitHub) <[email protected]> Wed, 18 Mar 2026 07:59:57 -0000
Newsgroups gmane.comp.jakarta.log4j.devel
Message-ID <ghd-D_kwDOAKJSSM4Aj8rl-ff48b58e-fadf-4609-a576-fa9008d727a5@gitbox.apache.org>
GitHub user ppkarwasz added a comment to the discussion: [ERROR]   class file for org.apache.logging.log4j.Logger not found

Your `Log4jHelper` class leaks Log4j API types in the **public** API (for example in `getLogger(Logger log)`), therefore `log4j-api` is required during compilation. If you remove them from the public API, compilation should work.

Maven doesn't have a scope to describe a situation, when a transitive dependency is not needed at runtime, but only during compilation, but other build systems have it. For example Gradle has the [`compileOnlyApi` configuration](https://docs.gradle.org/current/userguide/java_library_plugin.html#declarable_bucket_configurations).

GitHub link: https://github.com/apache/logging-log4j2/discussions/4046#discussioncomment-16189111

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]