Skip to content

mnovoseltsev/log4j2-springboot-plugins-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log4j2-springboot-plugins-issue

Steps to reproduce issue:

  1. Install jar of log4j-plugin-holder module with maven profile 'annotationProcOff' into local repo
  2. Run 'Sample App' application from IDE or maven plugin. Expected result is logger layout plugin found.
  3. Build a fat jar and run. Expected result is plugin is not found: "ERROR Console contains an invalid element or attribute 'SamplePlugin'"

If we would change first step to build artifact with annotation processsing ON, everything would work. But according to the Log4j2 documentation - https://logging.apache.org/log4j/2.x/manual/plugins.html:

In Log4j 2 a plugin is declared by adding a @Plugin annotation to the class declaration. During initialization the Configuration will invoke the PluginManager to load the built-in Log4j plugins as well as any custom plugins. The PluginManager locates plugins by looking in five places:

  1. Serialized plugin listing files on the classpath. These files are generated automatically during the build (more details below).

  2. (OSGi only) Serialized plugin listing files in each active OSGi bundle. A BundleListener is added on activation to continue checking new bundles after log4j-core has started.

  3. A comma-separated list of packages specified by the log4j.plugin.packages system property.

  4. Packages passed to the static PluginManager.addPackages method (before Log4j configuration occurs).

  5. The packages declared in your log4j2 configuration file.

So, It seems, last fifth point in bold doesn't work with custom spring boot jar classloading system.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages