avioconsulting / mule-custom-logger

Custom Mule logger to replace MuleSoft's out of the box logger. Use log4j2 layouts to convert log messages to JSON etc.
BSD 2-Clause "Simplified" License
13 stars 18 forks source link

Add support for automatic logging at the beginning and end of subflows #43

Open claytonflesher opened 2 years ago

claytonflesher commented 2 years ago

Just as v2 has automatic logging for beginning and end of flows, add support for this in subflows as well. Use the same flow logs checkbox there is now, just for subflows.

manikmagar commented 1 year ago

Flow execution logging is based on the notifications provided by the runtime. There are no similar notifications for Subflow which ultimately just executes in the same context as the calling flow. We could check flow-ref processor notifications and see if logging the start and end of that processor will help. Although, when calling async actions, the logs may not represent sub-flows execution.

manikmagar commented 6 months ago

@adesjardin @claytonflesher We implemented flow-ref span capture for the OTEL module by using a flow-ref interceptor and detecting if the target is a sub-flow or flow. We could use the same strategy to enable sub-flow start and end logs.

manikmagar commented 11 hours ago

This can also be done with notifications for a flow-ref processor with sub-flow as a target. Log the start and end of the flow-ref processor with the target name.