@Plugin(name="MessageLayout", category="Core", elementType="layout", printObject=true) public class MessageLayout extends AbstractLayout<Message>
LogEvent in its Message form.
Useful in combination with a JMS Appender to map a Log4j StringMapMessage to a JMS
MapMessage.
AbstractLayout.Builder<B extends AbstractLayout.Builder<B>>configuration, eventCount, footer, header, LOGGERELEMENT_TYPE| Constructor | Description |
|---|---|
MessageLayout() |
|
MessageLayout(Configuration configuration,
byte[] header,
byte[] footer) |
| Modifier and Type | Method | Description |
|---|---|---|
static Layout<?> |
createLayout() |
|
String |
getContentType() |
Returns the content type output by this layout.
|
byte[] |
toByteArray(LogEvent event) |
Formats the event suitable for display.
|
Message |
toSerializable(LogEvent event) |
Formats the event as an Object that can be serialized.
|
encode, getConfiguration, getContentFormat, getFooter, getHeader, markEventpublic MessageLayout(Configuration configuration, byte[] header, byte[] footer)
public MessageLayout()
public byte[] toByteArray(LogEvent event)
Layoutevent - The Logging Event.public Message toSerializable(LogEvent event)
Layoutevent - The Logging Event.public String getContentType()
Layout@PluginFactory public static Layout<?> createLayout()
Copyright © 1999-2018. 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.