Package io.axway.alf.log4j2
Class Log4j2Message
- java.lang.Object
-
- io.axway.alf.log4j2.Log4j2Message
-
- All Implemented Interfaces:
Serializable,org.apache.logging.log4j.message.Message,org.apache.logging.log4j.util.MessageSupplier,org.apache.logging.log4j.util.StringBuilderFormattable
public final class Log4j2Message extends Object implements org.apache.logging.log4j.util.MessageSupplier, org.apache.logging.log4j.message.Message, org.apache.logging.log4j.util.StringBuilderFormattable
This class converts a message with arguments into a Log4j2Message.When a log message is ignored (e.g. not printed in log files), Log4j2 processes
MessageSupplierobjects twice faster thanMessageobjects (even if message is not formatted).Having the same object implementing both
MessageSupplierandMessageis a bit faster than two separate objects.Benchmarks don't show significant performance improvements by implementing
StringBuilderFormattablebut it can't hurt and seems to be the norm other implementations- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidformatTo(StringBuilder buffer)org.apache.logging.log4j.message.Messageget()Consumer<Arguments>getArgs()StringgetFormat()StringgetFormattedMessage()StringgetMessage()Object[]getParameters()ThrowablegetThrowable()
-
-
-
Method Detail
-
getMessage
public String getMessage()
-
get
public org.apache.logging.log4j.message.Message get()
- Specified by:
getin interfaceorg.apache.logging.log4j.util.MessageSupplier
-
getFormattedMessage
public String getFormattedMessage()
- Specified by:
getFormattedMessagein interfaceorg.apache.logging.log4j.message.Message
-
formatTo
public void formatTo(StringBuilder buffer)
- Specified by:
formatToin interfaceorg.apache.logging.log4j.util.StringBuilderFormattable
-
getFormat
public String getFormat()
- Specified by:
getFormatin interfaceorg.apache.logging.log4j.message.Message
-
getParameters
public Object[] getParameters()
- Specified by:
getParametersin interfaceorg.apache.logging.log4j.message.Message
-
getThrowable
public Throwable getThrowable()
- Specified by:
getThrowablein interfaceorg.apache.logging.log4j.message.Message
-
-