Class DefaultExchangeFormatter
java.lang.Object
org.apache.camel.support.processor.DefaultExchangeFormatter
- All Implemented Interfaces:
org.apache.camel.spi.ExchangeFormatter
@UriParams
@Configurer
public class DefaultExchangeFormatter
extends Object
implements org.apache.camel.spi.ExchangeFormatter
Default
ExchangeFormatter that have fine grained options to configure what to include in the output.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFilters the headers or properties before formatting them.format(org.apache.camel.Exchange exchange) protected StringgetBodyAsString(org.apache.camel.Message message) protected StringgetBodyTypeAsString(org.apache.camel.Message message) intgetStyle()booleanbooleanisPlain()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanShows the route group (if exchange is being processed in routes)booleanbooleanbooleanbooleanbooleanvoidsetMaxChars(int maxChars) Limits the number of characters logged per line.voidsetMultiline(boolean multiline) If enabled then each information is outputted on a newline.voidsetPlain(boolean plain) If enabled only the body will be printed outvoidsetShowAll(boolean showAll) Quick option for turning all options on.voidsetShowAllProperties(boolean showAllProperties) Show all of the exchange properties (both internal and custom).voidsetShowBody(boolean showBody) voidsetShowBodyType(boolean showBodyType) Show the body Java type.voidsetShowCachedStreams(boolean showCachedStreams) Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache).voidsetShowCaughtException(boolean showCaughtException) If the exchange has a caught exception, show the exception message (no stack trace).voidsetShowException(boolean showException) If the exchange has an exception, show the exception message (no stacktrace)voidsetShowExchangeId(boolean showExchangeId) Show the unique exchange ID.voidsetShowExchangePattern(boolean showExchangePattern) Shows the Message Exchange Pattern (or MEP for short).voidsetShowFiles(boolean showFiles) If enabled Camel will output filesvoidsetShowFuture(boolean showFuture) If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged.voidsetShowHeaders(boolean showHeaders) Show the message headers.voidsetShowProperties(boolean showProperties) Show the exchange properties (only custom).voidsetShowRouteGroup(boolean showRouteGroup) voidsetShowRouteId(boolean showRouteId) Shows the route id (if exchange is being processed in routes)voidsetShowStackTrace(boolean showStackTrace) Show the stack trace, if an exchange has an exception.voidsetShowStreams(boolean showStreams) Whether Camel should show stream bodies or not (eg such as java.io.InputStream).voidsetShowVariables(boolean showVariables) Show the variables.voidsetSkipBodyLineSeparator(boolean skipBodyLineSeparator) Whether to skip line separators when logging the message body.voidSets the outputs style to use.
-
Field Details
-
LS
-
-
Constructor Details
-
DefaultExchangeFormatter
public DefaultExchangeFormatter()
-
-
Method Details
-
format
- Specified by:
formatin interfaceorg.apache.camel.spi.ExchangeFormatter
-
filterHeaderAndProperties
Filters the headers or properties before formatting them. No default behavior, but can be overridden. -
isShowRouteId
public boolean isShowRouteId() -
setShowRouteId
public void setShowRouteId(boolean showRouteId) Shows the route id (if exchange is being processed in routes) -
isShowRouteGroup
public boolean isShowRouteGroup()Shows the route group (if exchange is being processed in routes) -
setShowRouteGroup
public void setShowRouteGroup(boolean showRouteGroup) -
isShowExchangeId
public boolean isShowExchangeId() -
setShowExchangeId
public void setShowExchangeId(boolean showExchangeId) Show the unique exchange ID. -
isShowProperties
public boolean isShowProperties() -
setShowProperties
public void setShowProperties(boolean showProperties) Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties. -
isShowAllProperties
public boolean isShowAllProperties() -
setShowAllProperties
public void setShowAllProperties(boolean showAllProperties) Show all of the exchange properties (both internal and custom). -
isShowVariables
public boolean isShowVariables() -
setShowVariables
public void setShowVariables(boolean showVariables) Show the variables. -
isShowHeaders
public boolean isShowHeaders() -
setShowHeaders
public void setShowHeaders(boolean showHeaders) Show the message headers. -
isSkipBodyLineSeparator
public boolean isSkipBodyLineSeparator() -
setSkipBodyLineSeparator
public void setSkipBodyLineSeparator(boolean skipBodyLineSeparator) Whether to skip line separators when logging the message body. This allows to log the message body in one line, setting this option to false will preserve any line separators from the body, which then will log the body as is. -
isShowBodyType
public boolean isShowBodyType() -
setShowBodyType
public void setShowBodyType(boolean showBodyType) Show the body Java type. -
isShowBody
public boolean isShowBody() -
setShowBody
public void setShowBody(boolean showBody) -
isShowAll
public boolean isShowAll() -
setShowAll
public void setShowAll(boolean showAll) Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used) -
isShowException
public boolean isShowException() -
setShowException
public void setShowException(boolean showException) If the exchange has an exception, show the exception message (no stacktrace) -
isShowStackTrace
public boolean isShowStackTrace() -
setShowStackTrace
public void setShowStackTrace(boolean showStackTrace) Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled. -
isShowCaughtException
public boolean isShowCaughtException() -
setShowCaughtException
public void setShowCaughtException(boolean showCaughtException) If the exchange has a caught exception, show the exception message (no stack trace). A caught exception is stored as a property on the exchange (using the keyExchange.EXCEPTION_CAUGHTand for instance a doCatch can catch exceptions. -
isMultiline
public boolean isMultiline() -
getMaxChars
public int getMaxChars() -
setMaxChars
public void setMaxChars(int maxChars) Limits the number of characters logged per line. -
setMultiline
public void setMultiline(boolean multiline) If enabled then each information is outputted on a newline. -
isShowFuture
public boolean isShowFuture() -
setShowFuture
public void setShowFuture(boolean showFuture) If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged. -
isShowExchangePattern
public boolean isShowExchangePattern() -
setShowExchangePattern
public void setShowExchangePattern(boolean showExchangePattern) Shows the Message Exchange Pattern (or MEP for short). -
isShowCachedStreams
public boolean isShowCachedStreams() -
setShowCachedStreams
public void setShowCachedStreams(boolean showCachedStreams) Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache). -
isShowStreams
public boolean isShowStreams() -
setShowStreams
public void setShowStreams(boolean showStreams) Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use Stream Caching. -
isShowFiles
public boolean isShowFiles() -
setShowFiles
public void setShowFiles(boolean showFiles) If enabled Camel will output files -
getStyle
-
setStyle
Sets the outputs style to use. -
isPlain
public boolean isPlain() -
setPlain
public void setPlain(boolean plain) If enabled only the body will be printed out -
getBodyAsString
-
getBodyTypeAsString
-