Package org.apache.logging.log4j.plugins
Annotation Interface Configurable
@Retention(RUNTIME)
@Target({TYPE,TYPE_USE,FIELD,METHOD,PARAMETER})
@Documented
@Namespace("Core")
public @interface Configurable
Annotates a plugin as being a configurable plugin. A configurable plugin corresponds to a
Node
element
of a configuration tree. Each configuration element may have zero or more attributes
where attribute values are converted from strings into other types via TypeConverter
, an optional
value (another type of plugin attribute which may have dedicated syntax in some configuration
formats such as XML), and zero or more child elements. Configurable plugins are not the only type of plugin that
may be referenced in a configuration file; other plugin namespaces may define their own rules for interpreting
configuration data if the node tree representation is inadequate.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Indicates if construction and injection of child configuration nodes should be deferred until first use.Name of the corresponding category of elements this plugin belongs under.boolean
Indicates if the plugin class implements a usefulObject.toString()
method for use in debug log messages.
-
Element Details
-
elementType
String elementTypeName of the corresponding category of elements this plugin belongs under. For example,appender
would indicate an Appender plugin which would be in the<Appenders/>
element of a Configuration and is injected into aPluginElement
injection point of the containing plugin. When using a strict XML configuration format, the XML element name must match this value rather than the name of the plugin.- Returns:
- the element's type.
- Default:
- ""
-
printObject
boolean printObjectIndicates if the plugin class implements a usefulObject.toString()
method for use in debug log messages.- Returns:
- true if the object should print nicely.
- Default:
- false
-
deferChildren
boolean deferChildrenIndicates if construction and injection of child configuration nodes should be deferred until first use. When enabled, children plugins may only be injected asNode
instances and handled manually.- Returns:
- true if child elements should defer instantiation until they are accessed.
- Default:
- false
-