The log4j2 documentation shows the preferred method to produce custom components (such as appenders, filters and lookups). However, it is unclear on how to ensure that these custom components are picked up by the logging framework and useable by a logging configuration.
After placing a custom appender with the correct annotations in the classpath, what else do I need to do to be able to start including it in my log4j2.xml file and have it picked up by the logging framework?
To provide an example of this, if I annotate a custon appender with:
@Plugin(name = "Stub", category = "Core", elementType = "appender", printObject = true)
how do I get it to be picked up and used like this in the log4j2.xml configuration:
...
<Appenders>
<Stub name="stub">
...
</Stub>
...
</Appenders>
...