You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Tara Czutno <ja...@gmail.com> on 2016/02/23 01:20:34 UTC

Configuration for custom Filter

What configuration do I need in my log4j2.xml to use a custom Filter?

Do I need to "register" the filter with log4j2 somehow to use it?

Tara

Re: Configuration for custom Filter

Posted by Matt Sicker <bo...@gmail.com>.
Is your filter annotated with @Plugin? Does the class provide a
@PluginFactory static method or a @PluginBuilderFactory builder class? How
are you building your project? Because if you use your IDE instead of
Maven/Gradle/etc., you also have to enable annotation processing to build
up a metadata file for your plugins, or else you need to specify the
package to scan for your custom plugins in the config file (e.g.,
<Configuration package="com.foo.plugins">). Take a look at any of the
standard filters (like LevelRangeFilter) for an example of everything you
need to do.

On 22 February 2016 at 18:20, Tara Czutno <ja...@gmail.com> wrote:

> What configuration do I need in my log4j2.xml to use a custom Filter?
>
> Do I need to "register" the filter with log4j2 somehow to use it?
>
> Tara
>



-- 
Matt Sicker <bo...@gmail.com>