Log4j2 custom filter Log4j2 custom filter apache apache

Log4j2 custom filter


Can you show your config's first line, the <Configuration> element?

You can specify <Configuration status="trace"> to make log4j's internal logging appear on the console, which may help troubleshoot the issue.

Perhaps log4j has trouble finding your plugin.

When you compile your plugin a serialized plugin listing file is created. This file contains the name of your plugin and the classname in binary format. If this file is included in the jar containing your plugin class, log4j can find your plugin. Another way to help log4j find your plugin is to specify a packages attribute your config file:

<Configuration status="trace" packages="com.me.mycustomfilterpackage"> ...

For more detail, see this manual page on how the PluginManager tries to locate plugins.