...
Tip |
---|
title | Also a log in the DSL |
---|
|
There is also a log directly in the DSL, but it has a different purpose. Its meant for lightweight and human logs. See more details at LogEIP. |
Options
Div |
---|
class | confluenceTableSmall |
---|
|
Option | Default | Type | Description |
---|
level | INFO | String | Logging level to use. Possible values: ERROR , WARN , INFO , DEBUG , TRACE , OFF | marker | null | String | Camel 2.9: An optional Marker name to use. | groupSize | null | Integer | An integer that specifies a group size for throughput logging. | groupInterval | null | Integer | If specified will group message stats by this time interval (in millis) | groupDelay | 0 | Integer | Set the initial delay for stats (in millis) | groupActiveOnly | true | boolean | If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic | logger | | Logger | Camel |
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Option || Default || Type || Description ||
| {{level}} | {{INFO}} | {{String}} | Logging level to use. Possible values: {{ERROR}}, {{WARN}}, {{INFO}}, {{DEBUG}}, {{TRACE}}, {{OFF}} |
| {{marker}} | {{null}} | {{String}} | *Camel 2.9:* An optional [Marker|http://www.slf4j.org/api/org/slf4j/Marker.html] name to use. |
| {{groupSize}} | {{null}} | {{Integer}} | An integer that specifies a group size for throughput logging.|
| {{groupInterval}} | {{null}} | {{Integer}} | If specified will group message stats by this time interval (in millis) |
| {{groupDelay}} | {{0}} | {{Integer}} | Set the initial delay for stats (in millis) |
| {{groupActiveOnly}} | {{true}} | {{boolean}} | If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic |
| {{logger}} | | {{Logger}} | *Camel * [.slf4j.Logger|http://wwworg/api/org/slf4j/.html] |
{div} |
note: groupDelay and groupActiveOnly are only applicable when using groupInterval
...
The log formats the execution of exchanges to log lines.
By default, the log uses LogFormatter
to format the log output, where LogFormatter
has the following options:
Div |
---|
class | confluenceTableSmall |
---|
|
Option | Default | Description |
---|
showAll | false | Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used) | showExchangeId | false | Show the unique exchange ID. | showExchangePattern | true | Shows the Message Exchange Pattern (or MEP for short). | showProperties | false | Show the exchange properties. | showHeaders | false | Show the In message headers. | skipBodyLineSeparator | true | Camel |
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Option || Default || Description ||
| {{showAll}} | {{false}} | Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used) |
| {{showExchangeId}} | {{false}} | Show the unique exchange ID. |
| {{showExchangePattern}} | {{true}} | Shows the Message Exchange Pattern (or MEP for short). |
| {{showProperties}} | {{false}} | Show the exchange properties. |
| {{showHeaders}} | {{false}} | Show the In message headers. |
| {{skipBodyLineSeparator}} | {{true}} | *Camel * {{}} _ _. |
| {{showBodyType}} | {{true}} | Show the In body Java type. |
| {{showBody}} | {{true}} | Show the In body. |
| {{showOut}} | {{false}} | If the exchange has an Out message, show the Out message. |
| {{showException}} | {{false}} | If the exchange has an exception, show the exception message (no stack trace). |
| {{showCaughtException}} | {{false}} | 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 key {{Exchange.EXCEPTION_CAUGHT}}) and for instance a {{doCatch}} can catch exceptions. See [Try Catch Finally]. |
| {{showStackTrace}} | {{false}} | Show the stack trace, if an exchange has an exception. Only effective if one of {{showAll}}, {{showException}} or {{showCaughtException}} are enabled. |
| {{showFiles}} | {{false}} | *Camel 2.9:* Whether Camel should show file bodies or not (eg such as java.io.File). |
| {{showFuture}} | {{false}} | Whether Camel should show {{java.util.concurrent.Future}} bodies or not. If enabled Camel could potentially wait until the {{Future}} task is done. Will by default not wait. |
| {{showStreams}} | {{false}} | *Camel 2.8:* 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]. |
| {{multiline}} | {{false}} | If {{true}}, each piece of information is logged on a new line. |
| {{maxChars}} | | Limits the number of characters logged per line. The default value is {{10000}} from *Camel 2.9* onwards. |
{div}. | showBodyType | true | Show the In body Java type. | showBody | true | Show the In body. | showOut | false | If the exchange has an Out message, show the Out message. | showException | false | If the exchange has an exception, show the exception message (no stack trace). | showCaughtException | false | 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 key Exchange.EXCEPTION_CAUGHT ) and for instance a doCatch can catch exceptions. See Try Catch Finally. | showStackTrace | false | Show the stack trace, if an exchange has an exception. Only effective if one of showAll , showException or showCaughtException are enabled. | showFiles | false | Camel 2.9: Whether Camel should show file bodies or not (eg such as java.io.File). | showFuture | false | Whether Camel should show java.util.concurrent.Future bodies or not. If enabled Camel could potentially wait until the Future task is done. Will by default not wait. | showStreams | false | Camel 2.8: 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. | multiline | false | If true , each piece of information is logged on a new line. | maxChars | | Limits the number of characters logged per line. The default value is 10000 from Camel 2.9 onwards. |
|
Tip |
---|
title | Logging stream bodies |
---|
|
For older versions of Camel that do not support the showFiles or showStreams properties above, you can set the following property instead on the CamelContext to log both stream and file bodies: Code Block |
---|
camelContext.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, true);
|
|
...