org.apache.logging.log4j.core.config.plugins
Annotation Type PluginAttribute


@Documented
@Retention(value=RUNTIME)
@Target(value={PARAMETER,FIELD})
@PluginVisitorStrategy(value=PluginAttributeVisitor.class)
public @interface PluginAttribute

Identifies a Plugin Attribute and its default value. Note that only one of the defaultFoo attributes will be used based on the type this annotation is attached to. Thus, for primitive types, the defaultType attribute will be used for some Type. However, for more complex types (including enums), the default string value is used instead and should correspond to the string that would correctly convert to the appropriate enum value using Enum.valueOf.


Required Element Summary
 String value
          Specifies the name of the attribute (case-insensitive) this annotation corresponds to.
 
Optional Element Summary
 boolean defaultBoolean
          Specifies the default boolean value to use.
 byte defaultByte
          Specifies the default byte value to use.
 char defaultChar
          Specifies the default byte value to use.
 Class<?> defaultClass
          Specifies the default Class value to use.
 double defaultDouble
          Specifies the default double floating point value to use.
 float defaultFloat
          Specifies the default floating point value to use.
 int defaultInt
          Specifies the default integer value to use.
 long defaultLong
          Specifies the default long value to use.
 short defaultShort
          Specifies the default long value to use.
 String defaultString
          Specifies the default value this attribute should use if none is provided or if the provided value is invalid.
 boolean sensitive
          Indicates that this attribute is a sensitive one that shouldn't be logged directly.
 

Element Detail

value

public abstract String value
Specifies the name of the attribute (case-insensitive) this annotation corresponds to.

defaultBoolean

public abstract boolean defaultBoolean
Specifies the default boolean value to use.

Default:
false

defaultByte

public abstract byte defaultByte
Specifies the default byte value to use.

Default:
0

defaultChar

public abstract char defaultChar
Specifies the default byte value to use.

Default:
0

defaultClass

public abstract Class<?> defaultClass
Specifies the default Class value to use.

Default:
java.lang.Object.class

defaultDouble

public abstract double defaultDouble
Specifies the default double floating point value to use.

Default:
0.0

defaultFloat

public abstract float defaultFloat
Specifies the default floating point value to use.

Default:
0.0f

defaultInt

public abstract int defaultInt
Specifies the default integer value to use.

Default:
0

defaultLong

public abstract long defaultLong
Specifies the default long value to use.

Default:
0L

defaultShort

public abstract short defaultShort
Specifies the default long value to use.

Default:
0

defaultString

public abstract String defaultString
Specifies the default value this attribute should use if none is provided or if the provided value is invalid.

Default:
""

sensitive

public abstract boolean sensitive
Indicates that this attribute is a sensitive one that shouldn't be logged directly. Such attributes will instead be output as a hashed value.

Default:
false


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.