public interface Message extends Serializable
Note: Message objects should not be considered to be thread safe nor should they be assumed to be safely reusable even on the same thread. The logging system may provide information to the Message objects and the Messages might be queued for asynchronous delivery. Thus, any modifications to a Message object by an application should by avoided after the Message has been passed as a parameter on a Logger method.
TODO Interfaces should rarely extend Serializable according to Effective Java 2nd Ed pg 291. (RG) That section also says "If a class or interface exists primarily to participate in a framework that requires all participants to implement Serializable, then it makes perfect sense for the class or interface to implement or extend Serializable". Such is the case here as the LogEvent must be Serializable.Modifier and Type | Method and Description |
---|---|
String |
getFormat()
Gets the format portion of the Message.
|
String |
getFormattedMessage()
Gets the Message formatted as a String.
|
Object[] |
getParameters()
Gets parameter values, if any.
|
Throwable |
getThrowable()
Gets the throwable, if any.
|
String getFormattedMessage()
String getFormat()
Object[] getParameters()
Throwable getThrowable()
Copyright © 1999-2021 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.