message to log the result of an expression instead of the full dump:
flow:
- log:
message: Received ${method} ${path}
Streamed bodies are logged chunk by chunk. Output uses terminal colors per log level where supported; set the system property MEMBRANE_DISABLE_TERM_COLORS to true or false to override color detection. See the examples under examples/logging.Example Configuration
api:
port: 2000
flow:
- log:
level: INFO
body: false
target:
url: https://api.predic8.de
api:
port: 2000
flow:
- log:
level: INFO
body: false
target:
url: https://api.predic8.de
Syntax
log:
'$ref': <string>
body: <boolean>
category: <string>
label: <string>
language: groovy
level: trace
maskSensitive: <boolean>
message: <string>
xmlConfig: {}
log:
'$ref': <string>
body: <boolean>
category: <string>
label: <string>
language: groovy
level: trace
maskSensitive: <boolean>
message: <string>
xmlConfig: {}
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| $ref | false | - | Reference a component defined under components. | - |
| body | false | true | Whether to include message bodies in logs. Warning: Body logging can expose secrets or personal data. Prefer | - |
| category | false | Fully qualified class name of LogInterceptor com.predic8.membrane.core.interceptor.log.LogInterceptor | Logger category to use. Allows routing logs into different appenders/targets via Logback/Log4j configuration. | - |
| label | false | empty string | Short label printed with each log line to distinguish multiple log interceptors. Useful when several APIs share the same category but you want quick visual grouping. | "After Transformation" |
| language | false | SpEL | Scripting language used to evaluate the value expression. | SpEL | groovy | jsonpath | xpath |
| level | false | INFO | Log level for emitted messages. Values: TRACE, DEBUG, INFO, WARN, ERROR, FATAL | WARN |
| maskSensitive | false | true | Whether to mask sensitive header values such as Authorization, cookies, and API keys, replacing them with ****. | - |
| message | false | - | Expression whose result is logged instead of the full message dump. Evaluated in the configured language against the current exchange. | Received ${method} ${path} |
Child Structure
| Element | Cardinality | Description |
|---|---|---|
| xmlConfig | 0..1 | XML namespace declarations for XPath expressions in the value. |