From e5e634c5d933c8c950088d4f84cfec9d7c46c648 Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 10 Nov 2022 21:20:26 -0800 Subject: [PATCH 01/15] W-11984725-logger-revamp-duke --- .../pages/logger-component-reference.adoc | 79 ++++++++++++------- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index e9fc7f7d3d..ffb566d264 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -6,74 +6,99 @@ endif::[] This Core component helps you monitor and debug your Mule application by logging important information such as error messages, status notifications, payloads, and so on. You can add a Logger anywhere in a flow, and you can configure it to log a string that you specify, the output of a DataWeave expression you write, or any combination of strings and expressions. -[WARNING] --- -Keep in mind that the Logger is one of the only components that supports mixing Strings and expressions within a value. DataWeave String interpolation or concatenation within a single expression should be used elsewhere. --- +//TODO: IS THIS TRUE BEYOND ON-PREM INSTALLATIONS? +The configured messages are logged in a Mule application's log file, which is located in `MULE_HOME/logs/.log` if no custom log file path is specified in the `log4j2.xml` file. For details, see xref:logging-and-debugging.adoc[]. -The configured messages are logged to the app's log file, which is located in `MULE_HOME/logs/.log` if no custom log file path is specified in the `log4j2.xml` file. + -In Studio, the logs show in the Console. +In Anypoint Studio, the logs print to the xref:studio::index.adoc#console[console]. -The following example displays the message in Set Payload in a browser and also logs the message. +The following example logs the message. image::logger-flow.png[] .Example: XML Configuration of the Flow [source,xml,linenums] ---- - - + + + ---- -== Logger Configuration +In the Studio console, the logged message, `Hello MuleSoft!` looks like this: + +[source,logs] +---- +INFO 2022-11-10 19:39:18,222 [[MuleRuntime].uber.01: [w-logger].logger-example-Flow.CPU_LITE @6f862394] +[processor: logger-example-Flow/processors/1; event: 6bd2b350-6172-11ed-9f87-147ddaaf4f97] +org.mule.runtime.core.internal.processor.LoggerMessageProcessor: Hello MuleSoft! +---- + +* The configurable log level is `INFO`. See <>. +* A date-time stamp `2022-11-10 19:39:18,222` indicates when the Logger executes. +* CPU_LITE is the See xref:execution-engine.adoc#processing_types[processing type]. +* `event: 6bd2b350-6172-11ed-9f87-147ddaaf4f97` identifies the Mule event. +* The message processor `org.mule.runtime.core.internal.processor.LoggerMessageProcessor` prints the message `Hello MuleSoft!`. + +[[reference]] +== Reference image::logger.png[] -[%header%autowidth.spread,cols="a,a,a,a"] +[%header%autowidth.spread,cols="1a,1a,1a,4a"] |=== -| Field | Value | Description | Example +| Field | Attribute | Value | Description -| Message | String or DataWeave expression | Specifies the Mule log message. By default, messages are logged to the application's log file. | -`message="Current payload is #[payload]"` +| *Message* | `message` | String or DataWeave expression | Specifies the Mule log message. By default, messages are logged to the application's log file. Example: +`message="Current payload is #[payload]"`. Note that the Logger is one of the only components that supports this syntax to embed an expression (such as `#[payload]` within a string. Messages in other Mule components require string interpolation or concatenation within a single DataWeave expression. -| Level | -Available options: +| Level | `level` | Available options: * `DEBUG` * `ERROR` * `INFO`(Default) * `TRACE` * `WARN` | -Specifies the log level. - -| -`level="ERROR"` +Specifies the log level. Example: `level="ERROR"` -| Category | String | Optional setting that specifies a category name that it adds to `log4j2.xml` file. For example, you might use a category to route your log messages based on your category, or you might set log levels based on category. | +| Category | `category` | String | Optional setting that specifies a category name that it adds to `log4j2.xml` file. For example, you might use a category to route your log messages based on your category, or you might set log levels based on category. Example: `category="MyCustomCategory"` |=== == Examples -This Logger is set to monitor message processing status, mixing Strings and expressions: +This Logger monitors message processing status, mixing strings with a DataWeave selector expressions: -[source,xml,linenums] +[source,xml] ---- ---- -This Logger set to record the processing time of a flow, using a single expression and DataWeave's String concatenation: +Assuming a payload such as `{"id" : "100", "some-key" : "some value" }`, the Logger prints the message `Message 100 processed successfully`, for example: -[source,xml,linenums] +[source,xml] ---- - +INFO 2022-11-10 21:11:07,791 [[MuleRuntime].uber.09: [w-logger].logger-example-Flow.CPU_LITE @600dcddb] +[processor: logger-example-Flow/processors/1; event: 3fd13710-617f-11ed-900f-147ddaaf4f97] +org.mule.runtime.core.internal.processor.LoggerMessageProcessor: Message 100 processed successfully ---- +This Logger records the processing time of a flow, using a single expression and DataWeave concatenation: + +//TODO: Need to show how to get processing time or use a better example that doesn't throw an error. +[source,xml] +---- + +---- + +== Streamed Data + +//TODO: say something about how a logger handles streamed content + + == See also -xref:dataweave::dataweave-types.adoc#dw_type_string[DataWeave String Type] +* xref:dataweave::dataweave-types.adoc#dw_type_string[DataWeave String Type] From 6b0188ebf14e1cd354026904393a5be590b6e28e Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 10 Nov 2022 21:21:59 -0800 Subject: [PATCH 02/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index ffb566d264..c4696561b1 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -11,7 +11,7 @@ The configured messages are logged in a Mule application's log file, which is lo In Anypoint Studio, the logs print to the xref:studio::index.adoc#console[console]. -The following example logs the message. +The following example logs the message `Hello MuleSoft!`. image::logger-flow.png[] From 8c896f1492866269650201b9c3ef198b5278aff2 Mon Sep 17 00:00:00 2001 From: dukesphere Date: Fri, 11 Nov 2022 18:31:26 -0800 Subject: [PATCH 03/15] W-11984725-logger-revamp-duke --- .../pages/logger-component-reference.adoc | 178 +++++++++++++++--- modules/ROOT/pages/logging-and-debugging.adoc | 6 +- modules/ROOT/pages/logging-in-mule.adoc | 5 +- 3 files changed, 155 insertions(+), 34 deletions(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index c4696561b1..dc79a6cf8c 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -4,14 +4,11 @@ include::_attributes.adoc[] endif::[] :keywords: mule, esb, studio, logger, logs, log, notifications, errors, debug -This Core component helps you monitor and debug your Mule application by logging important information such as error messages, status notifications, payloads, and so on. You can add a Logger anywhere in a flow, and you can configure it to log a string that you specify, the output of a DataWeave expression you write, or any combination of strings and expressions. +Logs help you monitor and debug your Mule applications by printing important information such as error messages, status notifications, payload data, and so on. The Logger component (``) provides a way to add custom log messages to the logs. You can configure any number of Logger components in a flow to print a string, the output of a DataWeave expression, or any combination of strings and expressions. -//TODO: IS THIS TRUE BEYOND ON-PREM INSTALLATIONS? -The configured messages are logged in a Mule application's log file, which is located in `MULE_HOME/logs/.log` if no custom log file path is specified in the `log4j2.xml` file. For details, see xref:logging-and-debugging.adoc[]. +Mule applications print logs in several locations. In Anypoint Studio, the logs print to the xref:studio::index.adoc#console[console]. For information about application logs in a production environment, see xref:logging-in-mule.adoc#app_logs[App Logs]. -In Anypoint Studio, the logs print to the xref:studio::index.adoc#console[console]. - -The following example logs the message `Hello MuleSoft!`. +The following example logs the message `Hello MuleSoft!` at the default log level, `INFO`: image::logger-flow.png[] @@ -31,46 +28,67 @@ In the Studio console, the logged message, `Hello MuleSoft!` looks like this: [source,logs] ---- -INFO 2022-11-10 19:39:18,222 [[MuleRuntime].uber.01: [w-logger].logger-example-Flow.CPU_LITE @6f862394] -[processor: logger-example-Flow/processors/1; event: 6bd2b350-6172-11ed-9f87-147ddaaf4f97] +INFO 2022-11-10 19:39:18,222 [[MuleRuntime].uber.01: [w-logger].logger-example-Flow.CPU_LITE @6f862394] +[processor: logger-example-Flow/processors/1; event: 6bd2b350-6172-11ed-9f87-147ddaaf4f97] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: Hello MuleSoft! ---- * The configurable log level is `INFO`. See <>. -* A date-time stamp `2022-11-10 19:39:18,222` indicates when the Logger executes. +* A date-time stamp `2022-11-10 19:39:18,222` marks an execution of a Logger. * CPU_LITE is the See xref:execution-engine.adoc#processing_types[processing type]. -* `event: 6bd2b350-6172-11ed-9f87-147ddaaf4f97` identifies the Mule event. -* The message processor `org.mule.runtime.core.internal.processor.LoggerMessageProcessor` prints the message `Hello MuleSoft!`. +* `event: 6bd2b350-6172-11ed-9f87-147ddaaf4f97` identifies the Mule event to which the logged message applies. +* The message `LoggerMessageProcessor` processor prints the message `Hello MuleSoft!`. [[reference]] == Reference +The Logger provides configurable properties for the name of the logger, the message to log, the log level, and a string you can use to name or categorize a type of log message. + image::logger.png[] -[%header%autowidth.spread,cols="1a,1a,1a,4a"] +[%header%autowidth.spread,cols="1a,1a,4a"] |=== -| Field | Attribute | Value | Description +| Field | Attribute | Description -| *Message* | `message` | String or DataWeave expression | Specifies the Mule log message. By default, messages are logged to the application's log file. Example: -`message="Current payload is #[payload]"`. Note that the Logger is one of the only components that supports this syntax to embed an expression (such as `#[payload]` within a string. Messages in other Mule components require string interpolation or concatenation within a single DataWeave expression. +| *Message* | `message` | String or DataWeave expression that specifies the Mule log message. By default, messages log to the application's log file. Example: +`message="Current payload is \#[payload]"`. Note that the Logger is one of the only components that supports this syntax to embed an expression (such as `#[payload]` within a string. Messages in other Mule components require string interpolation or concatenation within a single DataWeave expression. -| Level | `level` | Available options: +| Level | `level` | Specifies a log level. `INFO` is the default. Available options: * `DEBUG` * `ERROR` -* `INFO`(Default) +* `INFO` * `TRACE` -* `WARN` | -Specifies the log level. Example: `level="ERROR"` +* `WARN` -| Category | `category` | String | Optional setting that specifies a category name that it adds to `log4j2.xml` file. For example, you might use a category to route your log messages based on your category, or you might set log levels based on category. Example: -`category="MyCustomCategory"` +Example: `level="ERROR"` +| Category | `category` | Optional string that specifies a category name that it adds to `log4j2.xml` file. For example, you might use a category to route your log messages based on your category, or you might set log levels based on category. Example: +`category="MyCustomCategory"`. |=== == Examples -This Logger monitors message processing status, mixing strings with a DataWeave selector expressions: +The following example you specifies a category `category="MyCustomCategory"` with the `message="My Message"`: + +[source,xml] +---- + +---- + +Notice that the category `MyCustomCategory` replaces the full package name of the processor, `org.mule.runtime.core.internal.processor.LoggerMessageProcessor`, for example: + +[source,logs] +---- +INFO 2022-11-11 15:17:53,138 [[MuleRuntime].uber.04: +[w-logger].logger-example-Flow.CPU_LITE @7ea85211] +[processor: logger-example-Flow/processors/1; +event: 113d6700-6217-11ed-86de-147ddaaf4f97] +MyCustomCategory: My Message +---- + +The following example places a DataWeave selector expression within a `message` string: [source,xml] ---- @@ -81,24 +99,126 @@ Assuming a payload such as `{"id" : "100", "some-key" : "some value" }`, the Log [source,xml] ---- -INFO 2022-11-10 21:11:07,791 [[MuleRuntime].uber.09: [w-logger].logger-example-Flow.CPU_LITE @600dcddb] -[processor: logger-example-Flow/processors/1; event: 3fd13710-617f-11ed-900f-147ddaaf4f97] -org.mule.runtime.core.internal.processor.LoggerMessageProcessor: Message 100 processed successfully +INFO 2022-11-10 21:11:07,791 [[MuleRuntime].uber.09: +[w-logger].logger-example-Flow.CPU_LITE @600dcddb] +[processor: logger-example-Flow/processors/1; +event: 3fd13710-617f-11ed-900f-147ddaaf4f97] +org.mule.runtime.core.internal.processor.LoggerMessageProcessor: +Message 100 processed successfully ---- This Logger records the processing time of a flow, using a single expression and DataWeave concatenation: -//TODO: Need to show how to get processing time or use a better example that doesn't throw an error. +//TODO: Need to show how to get processing time or use a better example that doesn't throw an error. [source,xml] ---- ---- -== Streamed Data +[[non_repeatable_streams]] +== Non-Repeatable Streams + +In Mule, a non-repeatable stream can be read only once. Unlike most other Mule components, the Logger does not convert such a stream to a non-streamed or repeatable form. + +If a Logger receives a Mule event with a payload that is configured as a non-repeatable stream, the Logger consumes the payload, so the payload received by the next component in the flow returns `null`. + +This scenario can occur if a Mule components, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). + +A component, such as Transform Message, converts such a payload into a non-streamed form. So a Logger located downstream of such a component no longer receives streamed payload. + +To illustrate this scenario, assume a Batch Aggregator that contains two Logger components is set to stream (`stream`) it input, the array `[1,2]`: + +[source,xml] +---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +---- + +* Logger 1, the first Logger component within the Aggregator, receives the array as a non-repeatable stream (`stream`), so it prints `[1, 2]` but passes an empty array `[]` to the next component in the Aggregator. +* The first Transform Message component receives the empty array from Logger 1 and sends it to Logger 2. So Logger 2 prints an _empty_ array (`[ ]`). +* The second Transform Message component appends `100` to the empty array, so Logger 3 prints the new payload, `[100]`. + +The Loggers print the following (edited for readability): + +[source,logs] +---- +INFO ...AGGREGATOR: FIRST LOGGER: [1, 2] +INFO ...AGGREGATOR: SECOND LOGGER: [ +] +INFO ... AGGREGATOR: THIRD LOGGER: [ + 100 +] +---- + +Assume a scenario in which the first Transform Message component is located before the Logger 1. In this case, the Logger prints the following (edited): + +[source,logs] +---- +INFO ...AGGREGATOR: FIRST LOGGER: [ + 1, + 2 +] +INFO ...AGGREGATOR: SECOND LOGGER: [ + 1, + 2 +] +INFO ... AGGREGATOR: THIRD LOGGER: [ + 1, + 2 + 100 +] +---- -//TODO: say something about how a logger handles streamed content +* Transform Message receives the streamed payload from the Aggregator but converts it to a non-streamed form. So the flow passes the unmodified array to Logger 1. +* Logger 1 prints the unmodified array in the payload, so it prints that array, `[1,2]`. +* The second Transform Message component appends `100` to the array, so Logger 3 prints the modified array, `[1,2,100]`. -== See also +== See Also +* xref:streaming-about.adoc[] * xref:dataweave::dataweave-types.adoc#dw_type_string[DataWeave String Type] diff --git a/modules/ROOT/pages/logging-and-debugging.adoc b/modules/ROOT/pages/logging-and-debugging.adoc index 20d97d87bb..fe53228eb0 100644 --- a/modules/ROOT/pages/logging-and-debugging.adoc +++ b/modules/ROOT/pages/logging-and-debugging.adoc @@ -9,10 +9,10 @@ Application logs and a runtime log help you monitor and troubleshoot your apps a You can xref:enable-verbose-logging.adoc[enable verbose logging] for connectors and modules to record debug level information in the logs. -The Logger component can help you monitor or even debug your Mule app by logging important information such as error messages, status notifications, payloads, and so on. You can add a Logger anywhere in a flow, and you can configure it to log a string that you specify, the output of a DataWeave expression you write, or any combination of strings and expressions. For details, see xref:logger-component-reference.adoc[Logger Component] in the Core component documentation. +The Logger component can help you monitor and debug your Mule app by printing important information such as error messages, status notifications, payload data, and so on to a log file and the Anypoint Studio console. You can one or more Logger components to a flow, and you can configure it to print a string that you specify, the output of a DataWeave expression you write, or any combination of strings and expressions. For details, see xref:logger-component-reference.adoc[Logger Component] in the Core component documentation. To control the display of Mule stack traces, you can use command-line arguments or set properties in Anypoint Studio. For details, see xref:configuring-mule-stacktraces.adoc[Configuring Mule Stack Traces]. -To troubleshoot a Mule app in Anypoint Studio, you can use the xref:studio::visual-debugger-concept.adoc[Studio Visual Debugger], which lets you set breakpoints to stop execution and check events. If you are creating your Mule app outside of Studio, you can either use MUnit to test your app, or you can activate remote debugging. For details, see xref:debugging-outside-studio.adoc[Debugging Outside Studio]. +To troubleshoot a Mule app in Anypoint Studio, you can use the xref:studio::visual-debugger-concept.adoc[Studio Visual Debugger], which lets you set breakpoints to stop execution and check events. If you are creating your Mule app outside of Studio, you can either use xref:munit::index.adoc[MUnit] to test your app, or you can activate remote debugging. For details, see xref:debugging-outside-studio.adoc[Debugging Outside Studio]. -If you are running your Mule application in CloudHub, see xref:runtime-manager::viewing-log-data.adoc[View Log Data] for additional information about log data and persistence. +If you are running your Mule application in CloudHub, see xref:runtime-manager::viewing-log-data.adoc[View Log Data] for additional information about log data and persistence. diff --git a/modules/ROOT/pages/logging-in-mule.adoc b/modules/ROOT/pages/logging-in-mule.adoc index 1d412e2b8a..700e3261ef 100644 --- a/modules/ROOT/pages/logging-in-mule.adoc +++ b/modules/ROOT/pages/logging-in-mule.adoc @@ -4,13 +4,14 @@ include::_attributes.adoc[] endif::[] :keywords: mule, studio, logger, logs, log, notifications, errors, debug -MuleSoft provides application logs and a runtime log to help you monitor and troubleshoot your Mule applications and the Mule instance. +MuleSoft provides application logs and a runtime log to help you monitor and troubleshoot your Mule applications and the Mule Runtime engine instance. +[[app_logs]] == App Logs Every app that you build in Studio comes with its own `log4j2.xml` file. The log contains information about any errors raised in the app (unless you have app logic to handle those errors). It also contains anything you want to explicitly log, if you build the logic in the app. -Mule automatically logs multiple messages and specific elements in your app flows to help you debug and keep track of events. You can also include the xref:logger-component-reference.adoc[Logger component] anywhere in a flow and set it up to output any message you want. +Mule automatically logs multiple messages and specific elements in your app flows to help you debug and keep track of events. You can also configure any number of xref:logger-component-reference.adoc[Logger components] in the flow to print log messages that you want. You can view an app log as follows: From 70869919deebd4f8264dda0c22d9262626f81578 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:07:44 -0800 Subject: [PATCH 04/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index dc79a6cf8c..68ee05eb03 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -118,7 +118,7 @@ This Logger records the processing time of a flow, using a single expression and [[non_repeatable_streams]] == Non-Repeatable Streams -In Mule, a non-repeatable stream can be read only once. Unlike most other Mule components, the Logger does not convert such a stream to a non-streamed or repeatable form. +In Mule, a non-repeatable stream can be read only once. The Logger consumes a payload that is streamed in a non-repeatable way and does not pass it to the next component in the flow. If a Logger receives a Mule event with a payload that is configured as a non-repeatable stream, the Logger consumes the payload, so the payload received by the next component in the flow returns `null`. From cc63bf042c73312dc49dccf7973963a858277148 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:08:32 -0800 Subject: [PATCH 05/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 68ee05eb03..7c4cfbab6f 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -120,7 +120,6 @@ This Logger records the processing time of a flow, using a single expression and In Mule, a non-repeatable stream can be read only once. The Logger consumes a payload that is streamed in a non-repeatable way and does not pass it to the next component in the flow. -If a Logger receives a Mule event with a payload that is configured as a non-repeatable stream, the Logger consumes the payload, so the payload received by the next component in the flow returns `null`. This scenario can occur if a Mule components, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). From 788f7c82ba7c16d18de3d9eb478af596e4888b6e Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:09:45 -0800 Subject: [PATCH 06/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 7c4cfbab6f..794192d26c 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -118,7 +118,7 @@ This Logger records the processing time of a flow, using a single expression and [[non_repeatable_streams]] == Non-Repeatable Streams -In Mule, a non-repeatable stream can be read only once. The Logger consumes a payload that is streamed in a non-repeatable way and does not pass it to the next component in the flow. +In Mule, a non-repeatable stream can be read only once. The Logger consumes a payload that is streamed in a non-repeatable way and does not pass it to the next component in the flow. In the next component, the `payload` selector returns a `null` or empty value. This scenario can occur if a Mule components, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). From 1c1f03ecb6c82432493a4dfc9202e1bfb3f8ed88 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:10:37 -0800 Subject: [PATCH 07/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 794192d26c..fff262de42 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -121,7 +121,7 @@ This Logger records the processing time of a flow, using a single expression and In Mule, a non-repeatable stream can be read only once. The Logger consumes a payload that is streamed in a non-repeatable way and does not pass it to the next component in the flow. In the next component, the `payload` selector returns a `null` or empty value. -This scenario can occur if a Mule components, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). +This scenario can occur if a Mule component, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). A component, such as Transform Message, converts such a payload into a non-streamed form. So a Logger located downstream of such a component no longer receives streamed payload. From 35492b7a6329e2723f0769dbbd23d9d4b0464a53 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:11:56 -0800 Subject: [PATCH 08/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index fff262de42..53b184338e 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -123,7 +123,7 @@ In Mule, a non-repeatable stream can be read only once. The Logger consumes a pa This scenario can occur if a Mule component, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). -A component, such as Transform Message, converts such a payload into a non-streamed form. So a Logger located downstream of such a component no longer receives streamed payload. +Unlike the Logger, many Mule components, such as Transform Message, convert such a payload into a non-streamed form. So a Logger located downstream of such a component no longer receives streamed payload. To illustrate this scenario, assume a Batch Aggregator that contains two Logger components is set to stream (`stream`) it input, the array `[1,2]`: From ac632d1dd6e83dbd266daf273689400544c81865 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:12:17 -0800 Subject: [PATCH 09/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 53b184338e..0d8c26afca 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -123,7 +123,6 @@ In Mule, a non-repeatable stream can be read only once. The Logger consumes a pa This scenario can occur if a Mule component, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). -Unlike the Logger, many Mule components, such as Transform Message, convert such a payload into a non-streamed form. So a Logger located downstream of such a component no longer receives streamed payload. To illustrate this scenario, assume a Batch Aggregator that contains two Logger components is set to stream (`stream`) it input, the array `[1,2]`: From 447c0e3042b9975549e930b3b846f36644a16334 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:17:31 -0800 Subject: [PATCH 10/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 0d8c26afca..09ccdf5681 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -192,7 +192,9 @@ INFO ... AGGREGATOR: THIRD LOGGER: [ ] ---- -Assume a scenario in which the first Transform Message component is located before the Logger 1. In this case, the Logger prints the following (edited): +Unlike the Logger, a Transform Message, converts its input into a non-streamed form. So a Logger located downstream of such a component does not receive a streamed payload. + +Assume a scenario in which the first Transform Message component from the <> is located _before_ the Logger 1. In this case, the Logger prints the following (edited): [source,logs] ---- From 48d4009003086251e001642b989e25a5e9686293 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:17:57 -0800 Subject: [PATCH 11/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 09ccdf5681..28e66c5b8b 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -124,6 +124,7 @@ In Mule, a non-repeatable stream can be read only once. The Logger consumes a pa This scenario can occur if a Mule component, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). +[[example]] To illustrate this scenario, assume a Batch Aggregator that contains two Logger components is set to stream (`stream`) it input, the array `[1,2]`: [source,xml] From e8a51f5aa959b860d2d540b360d98b996bf7fc79 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:19:54 -0800 Subject: [PATCH 12/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 28e66c5b8b..2b56b1178c 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -124,7 +124,7 @@ In Mule, a non-repeatable stream can be read only once. The Logger consumes a pa This scenario can occur if a Mule component, such as as a xref:file-connector::file-documentation.adoc#write[File Write operation] or the xref:batch-reference.adoc#ref_batch_aggregator_component[Batch Aggregator] component, is configured with a _non-repeatable_ streaming strategy (see xref:tuning-repeatable-nonrepeatable.adoc[]). -[[example]] +[[example_non_repeatable_stream]] To illustrate this scenario, assume a Batch Aggregator that contains two Logger components is set to stream (`stream`) it input, the array `[1,2]`: [source,xml] From 0e2636bf6027fbf3d784577166efb615d2322678 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:20:30 -0800 Subject: [PATCH 13/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index 2b56b1178c..ca1ff848d8 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -195,7 +195,7 @@ INFO ... AGGREGATOR: THIRD LOGGER: [ Unlike the Logger, a Transform Message, converts its input into a non-streamed form. So a Logger located downstream of such a component does not receive a streamed payload. -Assume a scenario in which the first Transform Message component from the <> is located _before_ the Logger 1. In this case, the Logger prints the following (edited): +Assume a scenario in which the first Transform Message component from the << example_non_repeatable_stream, preceding example>> is located _before_ the Logger 1. In this case, the Logger prints the following (edited): [source,logs] ---- From f57a9257d9b18c3b5ea6d245ee93f3614153cb15 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:22:08 -0800 Subject: [PATCH 14/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index ca1ff848d8..c5ef29bba6 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -4,7 +4,7 @@ include::_attributes.adoc[] endif::[] :keywords: mule, esb, studio, logger, logs, log, notifications, errors, debug -Logs help you monitor and debug your Mule applications by printing important information such as error messages, status notifications, payload data, and so on. The Logger component (``) provides a way to add custom log messages to the logs. You can configure any number of Logger components in a flow to print a string, the output of a DataWeave expression, or any combination of strings and expressions. +Logs help you monitor and debug your Mule applications by printing important information such as error messages, status notifications, payload data, and so on. The Logger component (``) provides a way to add custom log messages to the logs. You can configure any number of Logger components in a flow with a string, a DataWeave expression, or any combination of strings and expressions. Mule applications print logs in several locations. In Anypoint Studio, the logs print to the xref:studio::index.adoc#console[console]. For information about application logs in a production environment, see xref:logging-in-mule.adoc#app_logs[App Logs]. From aca0430a17d70a49af7a0630a132aa13dd2d0930 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 13 Nov 2022 07:30:27 -0800 Subject: [PATCH 15/15] Update modules/ROOT/pages/logger-component-reference.adoc --- modules/ROOT/pages/logger-component-reference.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/logger-component-reference.adoc b/modules/ROOT/pages/logger-component-reference.adoc index c5ef29bba6..92f9c25f2f 100644 --- a/modules/ROOT/pages/logger-component-reference.adoc +++ b/modules/ROOT/pages/logger-component-reference.adoc @@ -50,7 +50,7 @@ image::logger.png[] |=== | Field | Attribute | Description -| *Message* | `message` | String or DataWeave expression that specifies the Mule log message. By default, messages log to the application's log file. Example: +| *Message* | `message` | String or DataWeave expression that specifies the Mule log message. By default, messages log to the application's log file and in the console where the application runs, such as the Anypoint Studio console or the OS console for on-premises deployments. Example: `message="Current payload is \#[payload]"`. Note that the Logger is one of the only components that supports this syntax to embed an expression (such as `#[payload]` within a string. Messages in other Mule components require string interpolation or concatenation within a single DataWeave expression. | Level | `level` | Specifies a log level. `INFO` is the default. Available options: