This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit cf85ff4549a0cb5bb88ecafc9f8a2d6fd8ae95bc Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 15:05:04 2026 +0100 CAMEL-23832: camel-log - improve the component and option descriptions This commit rewrites the component description and the texts of 2 component options and 26 endpoint options of log. The new texts say which formatter and logger name win, when throughput logging is used, that the default output shows the exchange pattern anyway, what the stream, file and Future options log instead, and how maxChars and style work. The old showCaughtException text missed that it also shows the exception of the exchange. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-log is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../org/apache/camel/catalog/components/log.json | 58 ++--- .../apache/camel/catalog/docs/log-component.adoc | 2 +- .../org/apache/camel/component/log/log.json | 58 ++--- .../camel-log/src/main/docs/log-component.adoc | 2 +- .../apache/camel/component/log/LogComponent.java | 18 +- .../apache/camel/component/log/LogEndpoint.java | 154 ++++++------ .../component/ComponentsBuilderFactory.java | 4 +- .../component/dsl/LogComponentBuilderFactory.java | 23 +- .../builder/endpoint/StaticEndpointBuilders.java | 18 +- .../endpoint/dsl/LogEndpointBuilderFactory.java | 261 +++++++++++++-------- tasks/component-descriptions.md | 2 +- 11 files changed, 328 insertions(+), 272 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json index 4a07209394a4..251c4e0acd91 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json @@ -3,7 +3,7 @@ "kind": "component", "name": "log", "title": "Log Data", - "description": "Prints data from the routed message (such as body and headers) to the logger.", + "description": "Log the exchanges that pass through a route, or their throughput, with an SLF4J logger.", "deprecated": false, "firstVersion": "1.1.0", "label": "core,monitoring", @@ -26,48 +26,48 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "sourceLocationLoggerName": { "index": 1, "kind": "property", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled [...] + "sourceLocationLoggerName": { "index": 1, "kind": "property", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the log endpoints use the source location of the endpoint in the route, the file or class name and the line number, as the logger name instead of loggerName. The sourceLocationLogg [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "exchangeFormatter": { "index": 3, "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter." } + "exchangeFormatter": { "index": 3, "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "A custom org.apache.camel.spi.ExchangeFormatter for all log endpoints of this component. When set, the formatting options of the endpoints are not used. A bean named logFormatter in the regi [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ] }, "producerOut": { "carriers": [ "unchanged" ] } }, "properties": { - "loggerName": { "index": 0, "kind": "path", "displayName": "Logger Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of the logging category to use" }, - "groupActiveOnly": { "index": 1, "kind": "parameter", "displayName": "Group Active Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic." }, - "groupDelay": { "index": 2, "kind": "parameter", "displayName": "Group Delay", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Set the initial delay for stats (in millis)" }, - "groupInterval": { "index": 3, "kind": "parameter", "displayName": "Group Interval", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "If specified will group message stats by this time interval (in millis)" }, - "groupSize": { "index": 4, "kind": "parameter", "displayName": "Group Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "An integer that specifies a group size for throughput logging." }, - "level": { "index": 5, "kind": "parameter", "displayName": "Level", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "INFO", "description": "Logging level to use. The default value is INFO." }, - "logMask": { "index": 6, "kind": "parameter", "displayName": "Log Mask", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "If true, mask sensitive information like password or passphrase in the log." }, - "marker": { "index": 7, "kind": "parameter", "displayName": "Marker", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional Marker name to use." }, - "plain": { "index": 8, "kind": "parameter", "displayName": "Plain", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled only the body will be printed out" }, - "sourceLocationLoggerName": { "index": 9, "kind": "parameter", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled [...] + "loggerName": { "index": 0, "kind": "path", "displayName": "Logger Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the SLF4J logger, also called the logging category. It is not used when an org.slf4j.Logger is given, by the logger URI parameter or as the only Logger bean in the registry, or when sourceLocationLoggerName resolves a name." }, + "groupActiveOnly": { "index": 1, "kind": "parameter", "displayName": "Group Active Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the groupInterval throughput logging skips an interval in which no new exchanges arrived. If false, it logs the statistics every interval." }, + "groupDelay": { "index": 2, "kind": "parameter", "displayName": "Group Delay", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "The delay, in milliseconds, before the groupInterval throughput logging logs its first statistics. If not set, 1000 is used." }, + "groupInterval": { "index": 3, "kind": "parameter", "displayName": "Group Interval", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Turns on throughput logging: instead of each exchange, the endpoint logs statistics (the number of new and total exchanges and the messages per second) every interval, in milliseconds, from a background thread. It is not used w [...] + "groupSize": { "index": 4, "kind": "parameter", "displayName": "Group Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Turns on throughput logging: instead of each exchange, the endpoint logs statistics (the number of exchanges and the messages per second) after every groupSize exchanges. It takes precedence over groupInterval, and the formatting op [...] + "level": { "index": 5, "kind": "parameter", "displayName": "Level", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "INFO", "description": "The logging level of the log messages. OFF logs nothing." }, + "logMask": { "index": 6, "kind": "parameter", "displayName": "Log Mask", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether to mask sensitive values, such as passwords and passphrases, in the log message. If not set, the logMask setting of the route, or of the CamelContext, is used. A org.apache.camel.spi.MaskingFormatter bean named CamelCustomLogMas [...] + "marker": { "index": 7, "kind": "parameter", "displayName": "Marker", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of an SLF4J marker to add to each log message." }, + "plain": { "index": 8, "kind": "parameter", "displayName": "Plain", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log only the body, without the Exchange[...] wrapper and the other parts. The stream, file and maxChars options still apply to the body." }, + "sourceLocationLoggerName": { "index": 9, "kind": "parameter", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to use the source location of the log endpoint in the route, the file or class name and the line number, as the logger name instead of loggerName. If the source location is not kn [...] "lazyStartProducer": { "index": 10, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] - "exchangeFormatter": { "index": 11, "kind": "parameter", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom exchange formatter" }, - "maxChars": { "index": 12, "kind": "parameter", "displayName": "Max Chars", "group": "formatting", "label": "formatting", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10000, "description": "Limits the number of characters logged per line." }, - "multiline": { "index": 13, "kind": "parameter", "displayName": "Multiline", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then each information is outputted on a newline." }, - "showAll": { "index": 14, "kind": "parameter", "displayName": "Show All", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used)" }, + "exchangeFormatter": { "index": 11, "kind": "parameter", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": false, "secret": false, "description": "A custom org.apache.camel.spi.ExchangeFormatter that turns the exchange into the log message. When set, the formatting options of the endpoint are not used. If not set, the exchangeFormat [...] + "maxChars": { "index": 12, "kind": "parameter", "displayName": "Max Chars", "group": "formatting", "label": "formatting", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10000, "description": "The maximum number of characters to log. A longer body is cut at this length, and so is a longer log message, or each line of it with multiline. The global option CamelLogDebugBodyMaxChars, when set, replaces thi [...] + "multiline": { "index": 13, "kind": "parameter", "displayName": "Multiline", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log each part of the exchange on its own line." }, + "showAll": { "index": 14, "kind": "parameter", "displayName": "Show All", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show all parts of the exchange: the ID, the route group and route ID, the exchange pattern, all properties, the variables, the headers, the body type and body, the exception or caught exception, and its stack t [...] "showAllProperties": { "index": 15, "kind": "parameter", "displayName": "Show All Properties", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show all of the exchange properties (both internal and custom)." }, "showBody": { "index": 16, "kind": "parameter", "displayName": "Show Body", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Show the message body." }, "showBodyType": { "index": 17, "kind": "parameter", "displayName": "Show Body Type", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Show the body Java type." }, - "showCachedStreams": { "index": 18, "kind": "parameter", "displayName": "Show Cached Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache)." }, - "showCaughtException": { "index": 19, "kind": "parameter", "displayName": "Show Caught Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 org.apache.camel.Exchange# [...] - "showException": { "index": 20, "kind": "parameter", "displayName": "Show Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the exchange has an exception, show the exception message (no stacktrace)" }, + "showCachedStreams": { "index": 18, "kind": "parameter", "displayName": "Show Cached Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to log a body that is an org.apache.camel.StreamCache. The stream cache is reset after it is read, so the body can be read again later. If false, a placeholder is logged instead, unl [...] + "showCaughtException": { "index": 19, "kind": "parameter", "displayName": "Show Caught Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the type and message of the exception of the exchange or, if it has none, of the caught exception (not the stack trace). Camel stores a caught exception in the CamelExceptionCaught [...] + "showException": { "index": 20, "kind": "parameter", "displayName": "Show Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the exchange has an exception, show the type and message of the exception (not the stack trace)." }, "showExchangeId": { "index": 21, "kind": "parameter", "displayName": "Show Exchange Id", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the unique exchange ID." }, - "showExchangePattern": { "index": 22, "kind": "parameter", "displayName": "Show Exchange Pattern", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Shows the Message Exchange Pattern (or MEP for short)." }, - "showFiles": { "index": 23, "kind": "parameter", "displayName": "Show Files", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled Camel will output files" }, - "showFuture": { "index": 24, "kind": "parameter", "displayName": "Show Future", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged." }, + "showExchangePattern": { "index": 22, "kind": "parameter", "displayName": "Show Exchange Pattern", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the exchange pattern (InOnly or InOut). When none of the formatting options is set, the endpoint uses the default output of the component, which shows the exchange pattern anyway." }, + "showFiles": { "index": 23, "kind": "parameter", "displayName": "Show Files", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log the content of a body that is a file, such as a java.io.File, a java.nio.file.Path or a file of the file or ftp components. If false, a placeholder with the file name is logged instead." }, + "showFuture": { "index": 24, "kind": "parameter", "displayName": "Show Future", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to wait for a java.util.concurrent.Future body to complete and log its result. If false, the toString() of the Future is logged." }, "showHeaders": { "index": 25, "kind": "parameter", "displayName": "Show Headers", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the message headers." }, "showProperties": { "index": 26, "kind": "parameter", "displayName": "Show Properties", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties." }, - "showRouteGroup": { "index": 27, "kind": "parameter", "displayName": "Show Route Group", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show route Group." }, + "showRouteGroup": { "index": 27, "kind": "parameter", "displayName": "Show Route Group", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the group of the route, if the route has one." }, "showRouteId": { "index": 28, "kind": "parameter", "displayName": "Show Route Id", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show route ID." }, - "showStackTrace": { "index": 29, "kind": "parameter", "displayName": "Show Stack Trace", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled." }, - "showStreams": { "index": 30, "kind": "parameter", "displayName": "Show Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 bee [...] - "showVariables": { "index": 31, "kind": "parameter", "displayName": "Show Variables", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the variables." }, - "skipBodyLineSeparator": { "index": 32, "kind": "parameter", "displayName": "Skip Body Line Separator", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 t [...] - "style": { "index": 33, "kind": "parameter", "displayName": "Style", "group": "formatting", "label": "formatting", "required": false, "type": "enum", "javaType": "org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle", "enum": [ "Default", "Tab", "Fixed" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Default", "description": "Sets the outputs style to use." } + "showStackTrace": { "index": 29, "kind": "parameter", "displayName": "Show Stack Trace", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the stack trace of the exception that showException, showCaughtException or showAll shows. It has no effect without one of them." }, + "showStreams": { "index": 30, "kind": "parameter", "displayName": "Show Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log a body that is a stream, such as a java.io.InputStream or a java.io.Reader, or a stream cache. If false, a placeholder is logged instead. Beware that logging reads the stream, so later st [...] + "showVariables": { "index": 31, "kind": "parameter", "displayName": "Show Variables", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the variables of the exchange, if it has any." }, + "skipBodyLineSeparator": { "index": 32, "kind": "parameter", "displayName": "Skip Body Line Separator", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to remove the line separators of the operating system from the body, so the body is logged on one line. If false, the body is logged as is." }, + "style": { "index": 33, "kind": "parameter", "displayName": "Style", "group": "formatting", "label": "formatting", "required": false, "type": "enum", "javaType": "org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle", "enum": [ "Default", "Tab", "Fixed" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Default", "description": "The layout of the parts of the log message. Default separates them with a comma, as Label: value. Tab separates [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc index 734289cdddc1..c69b68072197 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc @@ -2,7 +2,7 @@ :doctitle: Log Data :shortname: log :artifactid: camel-log -:description: Prints data from the routed message (such as body and headers) to the logger. +:description: Log the exchanges that pass through a route, or their throughput, with an SLF4J logger. :since: 1.1 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-log/src/generated/resources/META-INF/org/apache/camel/component/log/log.json b/components/camel-log/src/generated/resources/META-INF/org/apache/camel/component/log/log.json index 4a07209394a4..251c4e0acd91 100644 --- a/components/camel-log/src/generated/resources/META-INF/org/apache/camel/component/log/log.json +++ b/components/camel-log/src/generated/resources/META-INF/org/apache/camel/component/log/log.json @@ -3,7 +3,7 @@ "kind": "component", "name": "log", "title": "Log Data", - "description": "Prints data from the routed message (such as body and headers) to the logger.", + "description": "Log the exchanges that pass through a route, or their throughput, with an SLF4J logger.", "deprecated": false, "firstVersion": "1.1.0", "label": "core,monitoring", @@ -26,48 +26,48 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "sourceLocationLoggerName": { "index": 1, "kind": "property", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled [...] + "sourceLocationLoggerName": { "index": 1, "kind": "property", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the log endpoints use the source location of the endpoint in the route, the file or class name and the line number, as the logger name instead of loggerName. The sourceLocationLogg [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "exchangeFormatter": { "index": 3, "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter." } + "exchangeFormatter": { "index": 3, "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "A custom org.apache.camel.spi.ExchangeFormatter for all log endpoints of this component. When set, the formatting options of the endpoints are not used. A bean named logFormatter in the regi [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ] }, "producerOut": { "carriers": [ "unchanged" ] } }, "properties": { - "loggerName": { "index": 0, "kind": "path", "displayName": "Logger Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of the logging category to use" }, - "groupActiveOnly": { "index": 1, "kind": "parameter", "displayName": "Group Active Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic." }, - "groupDelay": { "index": 2, "kind": "parameter", "displayName": "Group Delay", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Set the initial delay for stats (in millis)" }, - "groupInterval": { "index": 3, "kind": "parameter", "displayName": "Group Interval", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "If specified will group message stats by this time interval (in millis)" }, - "groupSize": { "index": 4, "kind": "parameter", "displayName": "Group Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "An integer that specifies a group size for throughput logging." }, - "level": { "index": 5, "kind": "parameter", "displayName": "Level", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "INFO", "description": "Logging level to use. The default value is INFO." }, - "logMask": { "index": 6, "kind": "parameter", "displayName": "Log Mask", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "If true, mask sensitive information like password or passphrase in the log." }, - "marker": { "index": 7, "kind": "parameter", "displayName": "Marker", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional Marker name to use." }, - "plain": { "index": 8, "kind": "parameter", "displayName": "Plain", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled only the body will be printed out" }, - "sourceLocationLoggerName": { "index": 9, "kind": "parameter", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled [...] + "loggerName": { "index": 0, "kind": "path", "displayName": "Logger Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the SLF4J logger, also called the logging category. It is not used when an org.slf4j.Logger is given, by the logger URI parameter or as the only Logger bean in the registry, or when sourceLocationLoggerName resolves a name." }, + "groupActiveOnly": { "index": 1, "kind": "parameter", "displayName": "Group Active Only", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the groupInterval throughput logging skips an interval in which no new exchanges arrived. If false, it logs the statistics every interval." }, + "groupDelay": { "index": 2, "kind": "parameter", "displayName": "Group Delay", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "The delay, in milliseconds, before the groupInterval throughput logging logs its first statistics. If not set, 1000 is used." }, + "groupInterval": { "index": 3, "kind": "parameter", "displayName": "Group Interval", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "Turns on throughput logging: instead of each exchange, the endpoint logs statistics (the number of new and total exchanges and the messages per second) every interval, in milliseconds, from a background thread. It is not used w [...] + "groupSize": { "index": 4, "kind": "parameter", "displayName": "Group Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Turns on throughput logging: instead of each exchange, the endpoint logs statistics (the number of exchanges and the messages per second) after every groupSize exchanges. It takes precedence over groupInterval, and the formatting op [...] + "level": { "index": 5, "kind": "parameter", "displayName": "Level", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "INFO", "description": "The logging level of the log messages. OFF logs nothing." }, + "logMask": { "index": 6, "kind": "parameter", "displayName": "Log Mask", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether to mask sensitive values, such as passwords and passphrases, in the log message. If not set, the logMask setting of the route, or of the CamelContext, is used. A org.apache.camel.spi.MaskingFormatter bean named CamelCustomLogMas [...] + "marker": { "index": 7, "kind": "parameter", "displayName": "Marker", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of an SLF4J marker to add to each log message." }, + "plain": { "index": 8, "kind": "parameter", "displayName": "Plain", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log only the body, without the Exchange[...] wrapper and the other parts. The stream, file and maxChars options still apply to the body." }, + "sourceLocationLoggerName": { "index": 9, "kind": "parameter", "displayName": "Source Location Logger Name", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to use the source location of the log endpoint in the route, the file or class name and the line number, as the logger name instead of loggerName. If the source location is not kn [...] "lazyStartProducer": { "index": 10, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] - "exchangeFormatter": { "index": 11, "kind": "parameter", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom exchange formatter" }, - "maxChars": { "index": 12, "kind": "parameter", "displayName": "Max Chars", "group": "formatting", "label": "formatting", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10000, "description": "Limits the number of characters logged per line." }, - "multiline": { "index": 13, "kind": "parameter", "displayName": "Multiline", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then each information is outputted on a newline." }, - "showAll": { "index": 14, "kind": "parameter", "displayName": "Show All", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used)" }, + "exchangeFormatter": { "index": 11, "kind": "parameter", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": false, "secret": false, "description": "A custom org.apache.camel.spi.ExchangeFormatter that turns the exchange into the log message. When set, the formatting options of the endpoint are not used. If not set, the exchangeFormat [...] + "maxChars": { "index": 12, "kind": "parameter", "displayName": "Max Chars", "group": "formatting", "label": "formatting", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10000, "description": "The maximum number of characters to log. A longer body is cut at this length, and so is a longer log message, or each line of it with multiline. The global option CamelLogDebugBodyMaxChars, when set, replaces thi [...] + "multiline": { "index": 13, "kind": "parameter", "displayName": "Multiline", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log each part of the exchange on its own line." }, + "showAll": { "index": 14, "kind": "parameter", "displayName": "Show All", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show all parts of the exchange: the ID, the route group and route ID, the exchange pattern, all properties, the variables, the headers, the body type and body, the exception or caught exception, and its stack t [...] "showAllProperties": { "index": 15, "kind": "parameter", "displayName": "Show All Properties", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show all of the exchange properties (both internal and custom)." }, "showBody": { "index": 16, "kind": "parameter", "displayName": "Show Body", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Show the message body." }, "showBodyType": { "index": 17, "kind": "parameter", "displayName": "Show Body Type", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Show the body Java type." }, - "showCachedStreams": { "index": 18, "kind": "parameter", "displayName": "Show Cached Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache)." }, - "showCaughtException": { "index": 19, "kind": "parameter", "displayName": "Show Caught Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 org.apache.camel.Exchange# [...] - "showException": { "index": 20, "kind": "parameter", "displayName": "Show Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the exchange has an exception, show the exception message (no stacktrace)" }, + "showCachedStreams": { "index": 18, "kind": "parameter", "displayName": "Show Cached Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to log a body that is an org.apache.camel.StreamCache. The stream cache is reset after it is read, so the body can be read again later. If false, a placeholder is logged instead, unl [...] + "showCaughtException": { "index": 19, "kind": "parameter", "displayName": "Show Caught Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the type and message of the exception of the exchange or, if it has none, of the caught exception (not the stack trace). Camel stores a caught exception in the CamelExceptionCaught [...] + "showException": { "index": 20, "kind": "parameter", "displayName": "Show Exception", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the exchange has an exception, show the type and message of the exception (not the stack trace)." }, "showExchangeId": { "index": 21, "kind": "parameter", "displayName": "Show Exchange Id", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the unique exchange ID." }, - "showExchangePattern": { "index": 22, "kind": "parameter", "displayName": "Show Exchange Pattern", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Shows the Message Exchange Pattern (or MEP for short)." }, - "showFiles": { "index": 23, "kind": "parameter", "displayName": "Show Files", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled Camel will output files" }, - "showFuture": { "index": 24, "kind": "parameter", "displayName": "Show Future", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged." }, + "showExchangePattern": { "index": 22, "kind": "parameter", "displayName": "Show Exchange Pattern", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the exchange pattern (InOnly or InOut). When none of the formatting options is set, the endpoint uses the default output of the component, which shows the exchange pattern anyway." }, + "showFiles": { "index": 23, "kind": "parameter", "displayName": "Show Files", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log the content of a body that is a file, such as a java.io.File, a java.nio.file.Path or a file of the file or ftp components. If false, a placeholder with the file name is logged instead." }, + "showFuture": { "index": 24, "kind": "parameter", "displayName": "Show Future", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to wait for a java.util.concurrent.Future body to complete and log its result. If false, the toString() of the Future is logged." }, "showHeaders": { "index": 25, "kind": "parameter", "displayName": "Show Headers", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the message headers." }, "showProperties": { "index": 26, "kind": "parameter", "displayName": "Show Properties", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties." }, - "showRouteGroup": { "index": 27, "kind": "parameter", "displayName": "Show Route Group", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show route Group." }, + "showRouteGroup": { "index": 27, "kind": "parameter", "displayName": "Show Route Group", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the group of the route, if the route has one." }, "showRouteId": { "index": 28, "kind": "parameter", "displayName": "Show Route Id", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show route ID." }, - "showStackTrace": { "index": 29, "kind": "parameter", "displayName": "Show Stack Trace", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled." }, - "showStreams": { "index": 30, "kind": "parameter", "displayName": "Show Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 bee [...] - "showVariables": { "index": 31, "kind": "parameter", "displayName": "Show Variables", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the variables." }, - "skipBodyLineSeparator": { "index": 32, "kind": "parameter", "displayName": "Skip Body Line Separator", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 t [...] - "style": { "index": 33, "kind": "parameter", "displayName": "Style", "group": "formatting", "label": "formatting", "required": false, "type": "enum", "javaType": "org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle", "enum": [ "Default", "Tab", "Fixed" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Default", "description": "Sets the outputs style to use." } + "showStackTrace": { "index": 29, "kind": "parameter", "displayName": "Show Stack Trace", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the stack trace of the exception that showException, showCaughtException or showAll shows. It has no effect without one of them." }, + "showStreams": { "index": 30, "kind": "parameter", "displayName": "Show Streams", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to log a body that is a stream, such as a java.io.InputStream or a java.io.Reader, or a stream cache. If false, a placeholder is logged instead. Beware that logging reads the stream, so later st [...] + "showVariables": { "index": 31, "kind": "parameter", "displayName": "Show Variables", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Show the variables of the exchange, if it has any." }, + "skipBodyLineSeparator": { "index": 32, "kind": "parameter", "displayName": "Skip Body Line Separator", "group": "formatting", "label": "formatting", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to remove the line separators of the operating system from the body, so the body is logged on one line. If false, the body is logged as is." }, + "style": { "index": 33, "kind": "parameter", "displayName": "Style", "group": "formatting", "label": "formatting", "required": false, "type": "enum", "javaType": "org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle", "enum": [ "Default", "Tab", "Fixed" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Default", "description": "The layout of the parts of the log message. Default separates them with a comma, as Label: value. Tab separates [...] } } diff --git a/components/camel-log/src/main/docs/log-component.adoc b/components/camel-log/src/main/docs/log-component.adoc index 734289cdddc1..c69b68072197 100644 --- a/components/camel-log/src/main/docs/log-component.adoc +++ b/components/camel-log/src/main/docs/log-component.adoc @@ -2,7 +2,7 @@ :doctitle: Log Data :shortname: log :artifactid: camel-log -:description: Prints data from the routed message (such as body and headers) to the logger. +:description: Log the exchanges that pass through a route, or their throughput, with an SLF4J logger. :since: 1.1 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java index ceb452537fb8..5e5ddef638b6 100644 --- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java +++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java @@ -43,9 +43,14 @@ public class LogComponent extends DefaultComponent { private ExchangeFormatter defaultExchangeFormatter; - @Metadata(label = "advanced", autowired = true) + @Metadata(label = "advanced", autowired = true, + description = "A custom org.apache.camel.spi.ExchangeFormatter for all log endpoints of this component. When" + + " set, the formatting options of the endpoints are not used. A bean named logFormatter in the" + + " registry takes precedence, and the exchangeFormatter option of an endpoint replaces both.") private ExchangeFormatter exchangeFormatter; - @Metadata + @Metadata(description = "Whether the log endpoints use the source location of the endpoint in the route, the file or class" + + " name and the line number, as the logger name instead of loggerName. The" + + " sourceLocationLoggerName option of an endpoint replaces this option.") private boolean sourceLocationLoggerName; public LogComponent() { @@ -125,10 +130,6 @@ public class LogComponent extends DefaultComponent { return exchangeFormatter; } - /** - * Sets a custom {@link ExchangeFormatter} to convert the Exchange to a String suitable for logging. If not - * specified, we default to {@link DefaultExchangeFormatter}. - */ public void setExchangeFormatter(ExchangeFormatter exchangeFormatter) { this.exchangeFormatter = exchangeFormatter; } @@ -137,11 +138,6 @@ public class LogComponent extends DefaultComponent { return sourceLocationLoggerName; } - /** - * If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger - * name, instead of the given name. However, if the source location is disabled or not possible to resolve then the - * existing logger name will be used. - */ public void setSourceLocationLoggerName(boolean sourceLocationLoggerName) { this.sourceLocationLoggerName = sourceLocationLoggerName; } diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java index ce89ba2e3c42..5dfba0595553 100644 --- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java +++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java @@ -43,7 +43,7 @@ import org.slf4j.Logger; import static org.apache.camel.support.LoggerHelper.getLineNumberLoggerName; /** - * Prints data from the routed message (such as body and headers) to the logger. + * Log the exchanges that pass through a route, or their throughput, with an SLF4J logger. */ @UriEndpoint(firstVersion = "1.1.0", scheme = "log", title = "Log Data", remote = false, internal = true, syntax = "log:loggerName", producerOnly = true, @@ -57,87 +57,125 @@ public class LogEndpoint extends ProcessorEndpoint implements LineNumberAware { private int lineNumber; private String location; - @UriPath(description = "Name of the logging category to use") + @UriPath(description = "The name of the SLF4J logger, also called the logging category. It is not used when an" + + " org.slf4j.Logger is given, by the logger URI parameter or as the only Logger bean in the registry," + + " or when sourceLocationLoggerName resolves a name.") @Metadata(required = true) private String loggerName; - @UriParam(defaultValue = "INFO", enums = "TRACE,DEBUG,INFO,WARN,ERROR,OFF") + @UriParam(defaultValue = "INFO", enums = "TRACE,DEBUG,INFO,WARN,ERROR,OFF", + description = "The logging level of the log messages. OFF logs nothing.") private String level; - @UriParam + @UriParam(description = "The name of an SLF4J marker to add to each log message.") private String marker; - @UriParam + @UriParam(description = "Turns on throughput logging: instead of each exchange, the endpoint logs statistics (the number" + + " of exchanges and the messages per second) after every groupSize exchanges. It takes precedence" + + " over groupInterval, and the formatting options are not used.") private Integer groupSize; - @UriParam + @UriParam(description = "Turns on throughput logging: instead of each exchange, the endpoint logs statistics (the number" + + " of new and total exchanges and the messages per second) every interval, in milliseconds, from a" + + " background thread. It is not used when groupSize is set.") private Long groupInterval; - @UriParam(defaultValue = "true") + @UriParam(defaultValue = "true", + description = "Whether the groupInterval throughput logging skips an interval in which no new exchanges" + + " arrived. If false, it logs the statistics every interval.") private boolean groupActiveOnly = true; - @UriParam + @UriParam(description = "The delay, in milliseconds, before the groupInterval throughput logging logs its first" + + " statistics. If not set, 1000 is used.") private Long groupDelay; - @UriParam + @UriParam(description = "Whether to mask sensitive values, such as passwords and passphrases, in the log message. If not" + + " set, the logMask setting of the route, or of the CamelContext, is used. A" + + " org.apache.camel.spi.MaskingFormatter bean named CamelCustomLogMask in the registry replaces the" + + " default masking.") private Boolean logMask; - @UriParam(label = "advanced") + @UriParam(label = "advanced", + description = "A custom org.apache.camel.spi.ExchangeFormatter that turns the exchange into the log message." + + " When set, the formatting options of the endpoint are not used. If not set, the exchangeFormatter" + + " of the component, or a bean named logFormatter in the registry, is used.") private ExchangeFormatter exchangeFormatter; @UriParam(label = "formatting", description = "Show route ID.") private boolean showRouteId; - @UriParam(label = "formatting", description = "Show route Group.") + @UriParam(label = "formatting", description = "Show the group of the route, if the route has one.") private boolean showRouteGroup; @UriParam(label = "formatting", description = "Show the unique exchange ID.") private boolean showExchangeId; @UriParam(label = "formatting", - description = "Shows the Message Exchange Pattern (or MEP for short).") + description = "Show the exchange pattern (InOnly or InOut). When none of the formatting options is set, the" + + " endpoint uses the default output of the component, which shows the exchange pattern anyway.") private boolean showExchangePattern; @UriParam(label = "formatting", description = "Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties.") private boolean showProperties; @UriParam(label = "formatting", description = "Show all of the exchange properties (both internal and custom).") private boolean showAllProperties; - @UriParam(label = "formatting", description = "Show the variables.") + @UriParam(label = "formatting", description = "Show the variables of the exchange, if it has any.") private boolean showVariables; @UriParam(label = "formatting", description = "Show the message headers.") private boolean showHeaders; @UriParam(label = "formatting", defaultValue = "true", - description = "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.") + description = "Whether to remove the line separators of the operating system from the body, so the body is" + + " logged on one line. If false, the body is logged as is.") private boolean skipBodyLineSeparator = true; @UriParam(label = "formatting", defaultValue = "true", description = "Show the message body.") private boolean showBody = true; @UriParam(label = "formatting", defaultValue = "true", description = "Show the body Java type.") private boolean showBodyType = true; @UriParam(label = "formatting", - description = "If the exchange has an exception, show the exception message (no stacktrace)") + description = "If the exchange has an exception, show the type and message of the exception (not the stack" + + " trace).") private boolean showException; @UriParam(label = "formatting", - description = "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 org.apache.camel.Exchange#EXCEPTION_CAUGHT) and for instance a doCatch can catch exceptions.") + description = "Show the type and message of the exception of the exchange or, if it has none, of the caught" + + " exception (not the stack trace). Camel stores a caught exception in the CamelExceptionCaught" + + " exchange property, for example when doCatch catches it or onException handles it.") private boolean showCaughtException; @UriParam(label = "formatting", - description = "Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled.") + description = "Show the stack trace of the exception that showException, showCaughtException or showAll" + + " shows. It has no effect without one of them.") private boolean showStackTrace; @UriParam(label = "formatting", - description = "Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used)") + description = "Show all parts of the exchange: the ID, the route group and route ID, the exchange pattern, all" + + " properties, the variables, the headers, the body type and body, the exception or caught exception," + + " and its stack trace. It does not change multiline, maxChars, or the stream, file and Future" + + " options.") private boolean showAll; - @UriParam(label = "formatting", description = "If enabled then each information is outputted on a newline.") + @UriParam(label = "formatting", description = "Whether to log each part of the exchange on its own line.") private boolean multiline; @UriParam(label = "formatting", - description = "If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged.") + description = "Whether to wait for a java.util.concurrent.Future body to complete and log its result. If false," + + " the toString() of the Future is logged.") private boolean showFuture; @UriParam(label = "formatting", defaultValue = "true", - description = "Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache).") + description = "Whether to log a body that is an org.apache.camel.StreamCache. The stream cache is reset after" + + " it is read, so the body can be read again later. If false, a placeholder is logged instead," + + " unless showStreams is true.") private boolean showCachedStreams = true; @UriParam(label = "formatting", - description = "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.") + description = "Whether to log a body that is a stream, such as a java.io.InputStream or a java.io.Reader, or a" + + " stream cache. If false, a placeholder is logged instead. Beware that logging reads the stream, so" + + " later steps may not be able to read the body; use stream caching to avoid this.") private boolean showStreams; - @UriParam(label = "formatting", description = "If enabled Camel will output files") + @UriParam(label = "formatting", + description = "Whether to log the content of a body that is a file, such as a java.io.File, a java.nio.file.Path" + + " or a file of the file or ftp components. If false, a placeholder with the file name is logged" + + " instead.") private boolean showFiles; - @UriParam(label = "formatting", defaultValue = "10000", description = "Limits the number of characters logged per line.") + @UriParam(label = "formatting", defaultValue = "10000", + description = "The maximum number of characters to log. A longer body is cut at this length, and so is a longer" + + " log message, or each line of it with multiline. The global option CamelLogDebugBodyMaxChars, when" + + " set, replaces this limit for the body.") private int maxChars = 10000; @UriParam(label = "formatting", enums = "Default,Tab,Fixed", defaultValue = "Default", - description = "Sets the outputs style to use.") + description = "The layout of the parts of the log message. Default separates them with a comma, as Label:" + + " value. Tab separates them with a tab, as Label: value. Fixed puts each value after a tab and the" + + " label padded to 20 characters.") private DefaultExchangeFormatter.OutputStyle style = DefaultExchangeFormatter.OutputStyle.Default; - @UriParam(defaultValue = "false", description = "If enabled only the body will be printed out") + @UriParam(defaultValue = "false", + description = "Whether to log only the body, without the Exchange[...] wrapper and the other parts. The stream," + + " file and maxChars options still apply to the body.") private boolean plain; - @UriParam(description = "If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead" - + " of the given name. However, if the source location is disabled or not possible to resolve then the existing logger name will be used.") + @UriParam(description = "Whether to use the source location of the log endpoint in the route, the file or class name and" + + " the line number, as the logger name instead of loggerName. If the source location is not known," + + " for example because source location is not enabled, loggerName is used.") private boolean sourceLocationLoggerName; public LogEndpoint() { @@ -326,92 +364,50 @@ public class LogEndpoint extends ProcessorEndpoint implements LineNumberAware { return null; } - /** - * Logging level to use. - * <p/> - * The default value is INFO. - */ public String getLevel() { return level; } - /** - * Logging level to use. - * <p/> - * The default value is INFO. - */ public void setLevel(String level) { this.level = level; } - /** - * An optional Marker name to use. - */ public String getMarker() { return marker; } - /** - * An optional Marker name to use. - */ public void setMarker(String marker) { this.marker = marker; } - /** - * An integer that specifies a group size for throughput logging. - */ public Integer getGroupSize() { return groupSize; } - /** - * An integer that specifies a group size for throughput logging. - */ public void setGroupSize(Integer groupSize) { this.groupSize = groupSize; } - /** - * If specified will group message stats by this time interval (in millis) - */ public Long getGroupInterval() { return groupInterval; } - /** - * If specified will group message stats by this time interval (in millis) - */ public void setGroupInterval(Long groupInterval) { this.groupInterval = groupInterval; } - /** - * If true, will hide stats when no new messages have been received for a time interval, if false, show stats - * regardless of message traffic. - */ public boolean isGroupActiveOnly() { return groupActiveOnly; } - /** - * If true, will hide stats when no new messages have been received for a time interval, if false, show stats - * regardless of message traffic. - */ public void setGroupActiveOnly(boolean groupActiveOnly) { this.groupActiveOnly = groupActiveOnly; } - /** - * Set the initial delay for stats (in millis) - */ public Long getGroupDelay() { return groupDelay; } - /** - * Set the initial delay for stats (in millis) - */ public void setGroupDelay(Long groupDelay) { this.groupDelay = groupDelay; } @@ -424,16 +420,10 @@ public class LogEndpoint extends ProcessorEndpoint implements LineNumberAware { this.providedLogger = providedLogger; } - /** - * The logger name to use - */ public String getLoggerName() { return loggerName; } - /** - * The logger name to use - */ public void setLoggerName(String loggerName) { this.loggerName = loggerName; } @@ -442,9 +432,6 @@ public class LogEndpoint extends ProcessorEndpoint implements LineNumberAware { return logMask; } - /** - * If true, mask sensitive information like password or passphrase in the log. - */ public void setLogMask(Boolean logMask) { this.logMask = logMask; } @@ -453,9 +440,6 @@ public class LogEndpoint extends ProcessorEndpoint implements LineNumberAware { return exchangeFormatter; } - /** - * To use a custom exchange formatter - */ public void setExchangeFormatter(ExchangeFormatter exchangeFormatter) { this.exchangeFormatter = exchangeFormatter; } diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 1ac86a19bd1b..33ecfa329aad 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -3574,8 +3574,8 @@ public interface ComponentsBuilderFactory { } /** * Log Data (camel-log) - * Prints data from the routed message (such as body and headers) to the - * logger. + * Log the exchanges that pass through a route, or their throughput, with an + * SLF4J logger. * * Category: core,monitoring * Since: 1.1 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/LogComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/LogComponentBuilderFactory.java index 666e0357a062..d0ce48805de3 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/LogComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/LogComponentBuilderFactory.java @@ -24,7 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.log.LogComponent; /** - * Prints data from the routed message (such as body and headers) to the logger. + * Log the exchanges that pass through a route, or their throughput, with an + * SLF4J logger. * * Generated by camel build tools - do NOT edit this file! */ @@ -33,8 +34,8 @@ public interface LogComponentBuilderFactory { /** * Log Data (camel-log) - * Prints data from the routed message (such as body and headers) to the - * logger. + * Log the exchanges that pass through a route, or their throughput, with an + * SLF4J logger. * * Category: core,monitoring * Since: 1.1 @@ -78,10 +79,10 @@ public interface LogComponentBuilderFactory { /** - * If enabled then the source location of where the log endpoint is used - * in Camel routes, would be used as logger name, instead of the given - * name. However, if the source location is disabled or not possible to - * resolve then the existing logger name will be used. + * Whether the log endpoints use the source location of the endpoint in + * the route, the file or class name and the line number, as the logger + * name instead of loggerName. The sourceLocationLoggerName option of an + * endpoint replaces this option. * * The option is a: <code>boolean</code> type. * @@ -119,9 +120,11 @@ public interface LogComponentBuilderFactory { } /** - * Sets a custom ExchangeFormatter to convert the Exchange to a String - * suitable for logging. If not specified, we default to - * DefaultExchangeFormatter. + * A custom org.apache.camel.spi.ExchangeFormatter for all log endpoints + * of this component. When set, the formatting options of the endpoints + * are not used. A bean named logFormatter in the registry takes + * precedence, and the exchangeFormatter option of an endpoint replaces + * both. * * The option is a: * <code>org.apache.camel.spi.ExchangeFormatter</code> type. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index e2785c1d536c..0b4abf618401 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -11968,8 +11968,8 @@ public class StaticEndpointBuilders { } /** * Log Data (camel-log) - * Prints data from the routed message (such as body and headers) to the - * logger. + * Log the exchanges that pass through a route, or their throughput, with an + * SLF4J logger. * * Category: core,monitoring * Since: 1.1 @@ -11978,7 +11978,10 @@ public class StaticEndpointBuilders { * Syntax: <code>log:loggerName</code> * * Path parameter: loggerName (required) - * Name of the logging category to use + * The name of the SLF4J logger, also called the logging category. It is not + * used when an org.slf4j.Logger is given, by the logger URI parameter or as + * the only Logger bean in the registry, or when sourceLocationLoggerName + * resolves a name. * * @param path loggerName * @return the dsl builder @@ -11988,8 +11991,8 @@ public class StaticEndpointBuilders { } /** * Log Data (camel-log) - * Prints data from the routed message (such as body and headers) to the - * logger. + * Log the exchanges that pass through a route, or their throughput, with an + * SLF4J logger. * * Category: core,monitoring * Since: 1.1 @@ -11998,7 +12001,10 @@ public class StaticEndpointBuilders { * Syntax: <code>log:loggerName</code> * * Path parameter: loggerName (required) - * Name of the logging category to use + * The name of the SLF4J logger, also called the logging category. It is not + * used when an org.slf4j.Logger is given, by the logger URI parameter or as + * the only Logger bean in the registry, or when sourceLocationLoggerName + * resolves a name. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java index 7dfcce30a5da..0c3d913c1478 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java @@ -27,7 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Prints data from the routed message (such as body and headers) to the logger. + * Log the exchanges that pass through a route, or their throughput, with an + * SLF4J logger. * * Generated by camel build tools - do NOT edit this file! */ @@ -45,8 +46,9 @@ public interface LogEndpointBuilderFactory { } /** - * If true, will hide stats when no new messages have been received for - * a time interval, if false, show stats regardless of message traffic. + * Whether the groupInterval throughput logging skips an interval in + * which no new exchanges arrived. If false, it logs the statistics + * every interval. * * The option is a: <code>boolean</code> type. * @@ -61,8 +63,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If true, will hide stats when no new messages have been received for - * a time interval, if false, show stats regardless of message traffic. + * Whether the groupInterval throughput logging skips an interval in + * which no new exchanges arrived. If false, it logs the statistics + * every interval. * * The option will be converted to a <code>boolean</code> type. * @@ -77,7 +80,8 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Set the initial delay for stats (in millis). + * The delay, in milliseconds, before the groupInterval throughput + * logging logs its first statistics. If not set, 1000 is used. * * The option is a: <code>java.lang.Long</code> type. * @@ -91,7 +95,8 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Set the initial delay for stats (in millis). + * The delay, in milliseconds, before the groupInterval throughput + * logging logs its first statistics. If not set, 1000 is used. * * The option will be converted to a <code>java.lang.Long</code> type. * @@ -105,8 +110,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If specified will group message stats by this time interval (in - * millis). + * Turns on throughput logging: instead of each exchange, the endpoint + * logs statistics (the number of new and total exchanges and the + * messages per second) every interval, in milliseconds, from a + * background thread. It is not used when groupSize is set. * * The option is a: <code>java.lang.Long</code> type. * @@ -120,8 +127,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If specified will group message stats by this time interval (in - * millis). + * Turns on throughput logging: instead of each exchange, the endpoint + * logs statistics (the number of new and total exchanges and the + * messages per second) every interval, in milliseconds, from a + * background thread. It is not used when groupSize is set. * * The option will be converted to a <code>java.lang.Long</code> type. * @@ -135,7 +144,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * An integer that specifies a group size for throughput logging. + * Turns on throughput logging: instead of each exchange, the endpoint + * logs statistics (the number of exchanges and the messages per second) + * after every groupSize exchanges. It takes precedence over + * groupInterval, and the formatting options are not used. * * The option is a: <code>java.lang.Integer</code> type. * @@ -149,7 +161,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * An integer that specifies a group size for throughput logging. + * Turns on throughput logging: instead of each exchange, the endpoint + * logs statistics (the number of exchanges and the messages per second) + * after every groupSize exchanges. It takes precedence over + * groupInterval, and the formatting options are not used. * * The option will be converted to a <code>java.lang.Integer</code> * type. @@ -164,7 +179,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Logging level to use. The default value is INFO. + * The logging level of the log messages. OFF logs nothing. * * The option is a: <code>java.lang.String</code> type. * @@ -179,8 +194,11 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If true, mask sensitive information like password or passphrase in - * the log. + * Whether to mask sensitive values, such as passwords and passphrases, + * in the log message. If not set, the logMask setting of the route, or + * of the CamelContext, is used. A org.apache.camel.spi.MaskingFormatter + * bean named CamelCustomLogMask in the registry replaces the default + * masking. * * The option is a: <code>java.lang.Boolean</code> type. * @@ -194,8 +212,11 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If true, mask sensitive information like password or passphrase in - * the log. + * Whether to mask sensitive values, such as passwords and passphrases, + * in the log message. If not set, the logMask setting of the route, or + * of the CamelContext, is used. A org.apache.camel.spi.MaskingFormatter + * bean named CamelCustomLogMask in the registry replaces the default + * masking. * * The option will be converted to a <code>java.lang.Boolean</code> * type. @@ -210,7 +231,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * An optional Marker name to use. + * The name of an SLF4J marker to add to each log message. * * The option is a: <code>java.lang.String</code> type. * @@ -224,7 +245,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled only the body will be printed out. + * Whether to log only the body, without the Exchange[...] wrapper and + * the other parts. The stream, file and maxChars options still apply to + * the body. * * The option is a: <code>boolean</code> type. * @@ -239,7 +262,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled only the body will be printed out. + * Whether to log only the body, without the Exchange[...] wrapper and + * the other parts. The stream, file and maxChars options still apply to + * the body. * * The option will be converted to a <code>boolean</code> type. * @@ -254,10 +279,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled then the source location of where the log endpoint is used - * in Camel routes, would be used as logger name, instead of the given - * name. However, if the source location is disabled or not possible to - * resolve then the existing logger name will be used. + * Whether to use the source location of the log endpoint in the route, + * the file or class name and the line number, as the logger name + * instead of loggerName. If the source location is not known, for + * example because source location is not enabled, loggerName is used. * * The option is a: <code>boolean</code> type. * @@ -272,10 +297,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled then the source location of where the log endpoint is used - * in Camel routes, would be used as logger name, instead of the given - * name. However, if the source location is disabled or not possible to - * resolve then the existing logger name will be used. + * Whether to use the source location of the log endpoint in the route, + * the file or class name and the line number, as the logger name + * instead of loggerName. If the source location is not known, for + * example because source location is not enabled, loggerName is used. * * The option will be converted to a <code>boolean</code> type. * @@ -290,7 +315,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Limits the number of characters logged per line. + * The maximum number of characters to log. A longer body is cut at this + * length, and so is a longer log message, or each line of it with + * multiline. The global option CamelLogDebugBodyMaxChars, when set, + * replaces this limit for the body. * * The option is a: <code>int</code> type. * @@ -305,7 +333,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Limits the number of characters logged per line. + * The maximum number of characters to log. A longer body is cut at this + * length, and so is a longer log message, or each line of it with + * multiline. The global option CamelLogDebugBodyMaxChars, when set, + * replaces this limit for the body. * * The option will be converted to a <code>int</code> type. * @@ -320,7 +351,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled then each information is outputted on a newline. + * Whether to log each part of the exchange on its own line. * * The option is a: <code>boolean</code> type. * @@ -335,7 +366,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled then each information is outputted on a newline. + * Whether to log each part of the exchange on its own line. * * The option will be converted to a <code>boolean</code> type. * @@ -350,8 +381,11 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Quick option for turning all options on. (multiline, maxChars has to - * be manually set if to be used). + * Show all parts of the exchange: the ID, the route group and route ID, + * the exchange pattern, all properties, the variables, the headers, the + * body type and body, the exception or caught exception, and its stack + * trace. It does not change multiline, maxChars, or the stream, file + * and Future options. * * The option is a: <code>boolean</code> type. * @@ -366,8 +400,11 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Quick option for turning all options on. (multiline, maxChars has to - * be manually set if to be used). + * Show all parts of the exchange: the ID, the route group and route ID, + * the exchange pattern, all properties, the variables, the headers, the + * body type and body, the exception or caught exception, and its stack + * trace. It does not change multiline, maxChars, or the stream, file + * and Future options. * * The option will be converted to a <code>boolean</code> type. * @@ -472,8 +509,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Whether Camel should show cached stream bodies or not - * (org.apache.camel.StreamCache). + * Whether to log a body that is an org.apache.camel.StreamCache. The + * stream cache is reset after it is read, so the body can be read again + * later. If false, a placeholder is logged instead, unless showStreams + * is true. * * The option is a: <code>boolean</code> type. * @@ -488,8 +527,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Whether Camel should show cached stream bodies or not - * (org.apache.camel.StreamCache). + * Whether to log a body that is an org.apache.camel.StreamCache. The + * stream cache is reset after it is read, so the body can be read again + * later. If false, a placeholder is logged instead, unless showStreams + * is true. * * The option will be converted to a <code>boolean</code> type. * @@ -504,10 +545,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * 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 org.apache.camel.Exchange#EXCEPTION_CAUGHT) - * and for instance a doCatch can catch exceptions. + * Show the type and message of the exception of the exchange or, if it + * has none, of the caught exception (not the stack trace). Camel stores + * a caught exception in the CamelExceptionCaught exchange property, for + * example when doCatch catches it or onException handles it. * * The option is a: <code>boolean</code> type. * @@ -522,10 +563,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * 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 org.apache.camel.Exchange#EXCEPTION_CAUGHT) - * and for instance a doCatch can catch exceptions. + * Show the type and message of the exception of the exchange or, if it + * has none, of the caught exception (not the stack trace). Camel stores + * a caught exception in the CamelExceptionCaught exchange property, for + * example when doCatch catches it or onException handles it. * * The option will be converted to a <code>boolean</code> type. * @@ -540,8 +581,8 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If the exchange has an exception, show the exception message (no - * stacktrace). + * If the exchange has an exception, show the type and message of the + * exception (not the stack trace). * * The option is a: <code>boolean</code> type. * @@ -556,8 +597,8 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If the exchange has an exception, show the exception message (no - * stacktrace). + * If the exchange has an exception, show the type and message of the + * exception (not the stack trace). * * The option will be converted to a <code>boolean</code> type. * @@ -602,7 +643,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Shows the Message Exchange Pattern (or MEP for short). + * Show the exchange pattern (InOnly or InOut). When none of the + * formatting options is set, the endpoint uses the default output of + * the component, which shows the exchange pattern anyway. * * The option is a: <code>boolean</code> type. * @@ -617,7 +660,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Shows the Message Exchange Pattern (or MEP for short). + * Show the exchange pattern (InOnly or InOut). When none of the + * formatting options is set, the endpoint uses the default output of + * the component, which shows the exchange pattern anyway. * * The option will be converted to a <code>boolean</code> type. * @@ -632,7 +677,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled Camel will output files. + * Whether to log the content of a body that is a file, such as a + * java.io.File, a java.nio.file.Path or a file of the file or ftp + * components. If false, a placeholder with the file name is logged + * instead. * * The option is a: <code>boolean</code> type. * @@ -647,7 +695,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled Camel will output files. + * Whether to log the content of a body that is a file, such as a + * java.io.File, a java.nio.file.Path or a file of the file or ftp + * components. If false, a placeholder with the file name is logged + * instead. * * The option will be converted to a <code>boolean</code> type. * @@ -662,8 +713,8 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled Camel will on Future objects wait for it to complete to - * obtain the payload to be logged. + * Whether to wait for a java.util.concurrent.Future body to complete + * and log its result. If false, the toString() of the Future is logged. * * The option is a: <code>boolean</code> type. * @@ -678,8 +729,8 @@ public interface LogEndpointBuilderFactory { return this; } /** - * If enabled Camel will on Future objects wait for it to complete to - * obtain the payload to be logged. + * Whether to wait for a java.util.concurrent.Future body to complete + * and log its result. If false, the toString() of the Future is logged. * * The option will be converted to a <code>boolean</code> type. * @@ -756,7 +807,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Show route Group. + * Show the group of the route, if the route has one. * * The option is a: <code>boolean</code> type. * @@ -771,7 +822,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Show route Group. + * Show the group of the route, if the route has one. * * The option will be converted to a <code>boolean</code> type. * @@ -816,8 +867,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Show the stack trace, if an exchange has an exception. Only effective - * if one of showAll, showException or showCaughtException are enabled. + * Show the stack trace of the exception that showException, + * showCaughtException or showAll shows. It has no effect without one of + * them. * * The option is a: <code>boolean</code> type. * @@ -832,8 +884,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Show the stack trace, if an exchange has an exception. Only effective - * if one of showAll, showException or showCaughtException are enabled. + * Show the stack trace of the exception that showException, + * showCaughtException or showAll shows. It has no effect without one of + * them. * * The option will be converted to a <code>boolean</code> type. * @@ -848,11 +901,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * 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. + * Whether to log a body that is a stream, such as a java.io.InputStream + * or a java.io.Reader, or a stream cache. If false, a placeholder is + * logged instead. Beware that logging reads the stream, so later steps + * may not be able to read the body; use stream caching to avoid this. * * The option is a: <code>boolean</code> type. * @@ -867,11 +919,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * 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. + * Whether to log a body that is a stream, such as a java.io.InputStream + * or a java.io.Reader, or a stream cache. If false, a placeholder is + * logged instead. Beware that logging reads the stream, so later steps + * may not be able to read the body; use stream caching to avoid this. * * The option will be converted to a <code>boolean</code> type. * @@ -886,7 +937,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Show the variables. + * Show the variables of the exchange, if it has any. * * The option is a: <code>boolean</code> type. * @@ -901,7 +952,7 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Show the variables. + * Show the variables of the exchange, if it has any. * * The option will be converted to a <code>boolean</code> type. * @@ -916,10 +967,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * 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. + * Whether to remove the line separators of the operating system from + * the body, so the body is logged on one line. If false, the body is + * logged as is. * * The option is a: <code>boolean</code> type. * @@ -934,10 +984,9 @@ public interface LogEndpointBuilderFactory { return this; } /** - * 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. + * Whether to remove the line separators of the operating system from + * the body, so the body is logged on one line. If false, the body is + * logged as is. * * The option will be converted to a <code>boolean</code> type. * @@ -952,7 +1001,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Sets the outputs style to use. + * The layout of the parts of the log message. Default separates them + * with a comma, as Label: value. Tab separates them with a tab, as + * Label: value. Fixed puts each value after a tab and the label padded + * to 20 characters. * * The option is a: * <code>org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle</code> type. @@ -968,7 +1020,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * Sets the outputs style to use. + * The layout of the parts of the log message. Default separates them + * with a comma, as Label: value. Tab separates them with a tab, as + * Label: value. Fixed puts each value after a tab and the label padded + * to 20 characters. * * The option will be converted to a * <code>org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle</code> type. @@ -1042,7 +1097,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * To use a custom exchange formatter. + * A custom org.apache.camel.spi.ExchangeFormatter that turns the + * exchange into the log message. When set, the formatting options of + * the endpoint are not used. If not set, the exchangeFormatter of the + * component, or a bean named logFormatter in the registry, is used. * * The option is a: <code>org.apache.camel.spi.ExchangeFormatter</code> * type. @@ -1057,7 +1115,10 @@ public interface LogEndpointBuilderFactory { return this; } /** - * To use a custom exchange formatter. + * A custom org.apache.camel.spi.ExchangeFormatter that turns the + * exchange into the log message. When set, the formatting options of + * the endpoint are not used. If not set, the exchangeFormatter of the + * component, or a bean named logFormatter in the registry, is used. * * The option will be converted to a * <code>org.apache.camel.spi.ExchangeFormatter</code> type. @@ -1076,8 +1137,8 @@ public interface LogEndpointBuilderFactory { public interface LogBuilders { /** * Log Data (camel-log) - * Prints data from the routed message (such as body and headers) to the - * logger. + * Log the exchanges that pass through a route, or their throughput, + * with an SLF4J logger. * * Category: core,monitoring * Since: 1.1 @@ -1086,7 +1147,10 @@ public interface LogEndpointBuilderFactory { * Syntax: <code>log:loggerName</code> * * Path parameter: loggerName (required) - * Name of the logging category to use + * The name of the SLF4J logger, also called the logging category. It is + * not used when an org.slf4j.Logger is given, by the logger URI + * parameter or as the only Logger bean in the registry, or when + * sourceLocationLoggerName resolves a name. * * @param path loggerName * @return the dsl builder @@ -1096,8 +1160,8 @@ public interface LogEndpointBuilderFactory { } /** * Log Data (camel-log) - * Prints data from the routed message (such as body and headers) to the - * logger. + * Log the exchanges that pass through a route, or their throughput, + * with an SLF4J logger. * * Category: core,monitoring * Since: 1.1 @@ -1106,7 +1170,10 @@ public interface LogEndpointBuilderFactory { * Syntax: <code>log:loggerName</code> * * Path parameter: loggerName (required) - * Name of the logging category to use + * The name of the SLF4J logger, also called the logging category. It is + * not used when an org.slf4j.Logger is given, by the logger URI + * parameter or as the only Logger bean in the registry, or when + * sourceLocationLoggerName resolves a name. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index b4417f3a1835..22e11f395237 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -261,7 +261,7 @@ or removes its row. | camel-language | language | | | camel-ldap | ldap | | | camel-ldif | ldif | yes | -| camel-log | log | | +| camel-log | log | yes | | camel-lucene | lucene | | | camel-lumberjack | lumberjack | | | camel-mail | imap, imaps, pop3, pop3s, smtp, smtps | |
