Skip to content
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

Log4j2 config - packages property for plugins will be deprecated #162

Open
Icetea1991 opened this issue Sep 8, 2023 · 3 comments
Open

Comments

@Icetea1991
Copy link

Hello colleagues,

I just build in log4j2 with the exemplary config provided here:
https://github.com/SAP/cf-java-logging-support/blob/main/sample/src/main/resources/log4j2.xml

When running my tests so far, I receive a warning:

WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release

At the official page they mark it also as deprecated: https://logging.apache.org/log4j/2.x/manual/plugins.html

Not sure if you need to adapt the implementation of your actual plugins, but at least the configs needs to be adapted.

Kind regards
Hendrik

@KarstenSchnitter
Copy link
Contributor

KarstenSchnitter commented Sep 11, 2023

Hi Hendrik,

Thanks for reaching out. In my understanding, the package scanning is required to find the @Plugin annotations, e.g. in

@Plugin(name = "JsonPatternLayout", category = "Core", elementType = "Layout", printObject = true)
public final class JsonPatternLayout extends AbstractStringLayout {
. I will investigate, what can be done to avoid the warnings.

Best Regards,
Karsten

@Icetea1991
Copy link
Author

Hi Karsten,

as described here:
https://logging.apache.org/log4j/2.x/manual/plugins.html

as far as I understand it you would only need to add the execution for the pluginProcessor in your maven-compiler-plugin which then outputs a metadata file for the found plugins? Not sure if I got that right

Below that is a text with another couple of requirements a plugin needs to fulfill, not sure if that is already done with the current implementation fo your plugins

@KarstenSchnitter
Copy link
Contributor

I will try to implement the documented first approach "Serialized plugin listing files on the classpath.".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants