ops4j / org.ops4j.pax.logging

The OSGi Logging framework implementation. Supports SLF4J,LOG4J,JCL etc.
https://ops4j1.jira.com/wiki/spaces/paxlogging/overview
Apache License 2.0
46 stars 79 forks source link

Warn message for package scanning deprecation from pax-logging-api #549

Open HeshanSudarshana opened 4 months ago

HeshanSudarshana commented 4 months ago

Hi,

We are currently using pax-logging version 2.1.0 currently and trying to migrate to the latest 2.2.7 version.

When trying to start the server I'm getting the following warning multiple times.

org.ops4j.pax.logging.pax-logging-api [log4j2] WARN : The use of package scanning to locate plugins is deprecated and will be removed in a future release

Further debugging the issue I identified that this is yielding from the line [1] in log4j-core version 2.22.1. This seems to be due to the following packages added from the PluginManager the pax-logging-log4j2 component [2].

Therefore, even there are no packages from our side, the warning messages are logged. Is there a way to work around this or am I missing something?

[1] https://github.com/apache/logging-log4j2/blob/rel/2.22.1/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java#L128 [2] https://github.com/ops4j/org.ops4j.pax.logging/blob/logging-2.2.7/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java#L79

Thanks in advance!

grgrzybek commented 4 months ago

Thanks for the issue @HeshanSudarshana. #521 was created to prepare for next major Log4j release (3.0) and till then we'll be keeping Pax Logging 2.2.x compatible with Log4j2 2.x. This means upgrading to newer 2.22.0, 2.22.1, ..., etc. releases, but such warnings may appear unfortunately.

There's no way to quite down this message because I don't think we should change the way Pax Logging itself adds its plugin to Log4j2...

So please understand - we'll check this issue at next Pax Logging release (2.3.x).

HeshanSudarshana commented 4 months ago

Thanks for the response @grgrzybek, I understand that these kind of issues can occur when upgrading to the latest versions.

However, shouldn't the changes be done to avoid the usages of deprecated methods such as PluginManager.addPackages in a 2.2.x patch version as well?

grgrzybek commented 4 months ago

deprecation in 2.22.x doesn't mean it'd be removed in any next 2.x (I hope). Anyway - I'm keeping the issue open, so I may review it and think about it. But to be honest I'm quite busy now with completely different issues (React...)