@UriParams public class DefaultExchangeFormatter extends Object implements ExchangeFormatter
ExchangeFormatter
that have fine grained options to configure what to include in the output.Modifier and Type | Class and Description |
---|---|
static class |
DefaultExchangeFormatter.OutputStyle |
Constructor and Description |
---|
DefaultExchangeFormatter() |
Modifier and Type | Method and Description |
---|---|
String |
format(Exchange exchange)
Generates a string representation of the exchange
|
protected String |
getBodyAsString(Message message) |
protected String |
getBodyTypeAsString(Message message) |
int |
getMaxChars() |
DefaultExchangeFormatter.OutputStyle |
getStyle() |
boolean |
isMultiline() |
boolean |
isShowAll() |
boolean |
isShowBody() |
boolean |
isShowBodyType() |
boolean |
isShowCaughtException() |
boolean |
isShowException() |
boolean |
isShowExchangeId() |
boolean |
isShowExchangePattern() |
boolean |
isShowFiles() |
boolean |
isShowFuture() |
boolean |
isShowHeaders() |
boolean |
isShowOut() |
boolean |
isShowProperties() |
boolean |
isShowStackTrace() |
boolean |
isShowStreams() |
boolean |
isSkipBodyLineSeparator() |
void |
setMaxChars(int maxChars)
Limits the number of characters logged per line.
|
void |
setMultiline(boolean multiline)
If enabled then each information is outputted on a newline.
|
void |
setShowAll(boolean showAll)
Quick option for turning all options on.
|
void |
setShowBody(boolean showBody) |
void |
setShowBodyType(boolean showBodyType)
Show the body Java type.
|
void |
setShowCaughtException(boolean showCaughtException)
f the exchange has a caught exception, show the exception message (no stack trace).
|
void |
setShowException(boolean showException)
If the exchange has an exception, show the exception message (no stacktrace)
|
void |
setShowExchangeId(boolean showExchangeId)
Show the unique exchange ID.
|
void |
setShowExchangePattern(boolean showExchangePattern)
Shows the Message Exchange Pattern (or MEP for short).
|
void |
setShowFiles(boolean showFiles)
If enabled Camel will output files
|
void |
setShowFuture(boolean showFuture)
If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged.
|
void |
setShowHeaders(boolean showHeaders)
Show the message headers.
|
void |
setShowOut(boolean showOut)
If the exchange has an out message, show the out message.
|
void |
setShowProperties(boolean showProperties)
Show the exchange properties.
|
void |
setShowStackTrace(boolean showStackTrace)
Show the stack trace, if an exchange has an exception.
|
void |
setShowStreams(boolean showStreams)
Whether Camel should show stream bodies or not (eg such as java.io.InputStream).
|
void |
setSkipBodyLineSeparator(boolean skipBodyLineSeparator)
Whether to skip line separators when logging the message body.
|
void |
setStyle(DefaultExchangeFormatter.OutputStyle style)
Sets the outputs style to use.
|
public DefaultExchangeFormatter()
public String format(Exchange exchange)
ExchangeFormatter
format
in interface ExchangeFormatter
exchange
- the exchangepublic boolean isShowExchangeId()
public void setShowExchangeId(boolean showExchangeId)
public boolean isShowProperties()
public void setShowProperties(boolean showProperties)
public boolean isShowHeaders()
public void setShowHeaders(boolean showHeaders)
public boolean isSkipBodyLineSeparator()
public void setSkipBodyLineSeparator(boolean skipBodyLineSeparator)
public boolean isShowBodyType()
public void setShowBodyType(boolean showBodyType)
public boolean isShowBody()
public void setShowBody(boolean showBody)
public boolean isShowOut()
public void setShowOut(boolean showOut)
public boolean isShowAll()
public void setShowAll(boolean showAll)
public boolean isShowException()
public void setShowException(boolean showException)
public boolean isShowStackTrace()
public void setShowStackTrace(boolean showStackTrace)
public boolean isShowCaughtException()
public void setShowCaughtException(boolean showCaughtException)
Exchange.EXCEPTION_CAUGHT
and for instance a doCatch can catch exceptions.public boolean isMultiline()
public int getMaxChars()
public void setMaxChars(int maxChars)
public void setMultiline(boolean multiline)
public boolean isShowFuture()
public void setShowFuture(boolean showFuture)
public boolean isShowExchangePattern()
public void setShowExchangePattern(boolean showExchangePattern)
public boolean isShowStreams()
public void setShowStreams(boolean showStreams)
public boolean isShowFiles()
public void setShowFiles(boolean showFiles)
public DefaultExchangeFormatter.OutputStyle getStyle()
public void setStyle(DefaultExchangeFormatter.OutputStyle style)
protected String getBodyAsString(Message message)
protected String getBodyTypeAsString(Message message)
Apache Camel