4. Monitoring, Logging and Statistics

log

Logs request and response messages. The messages will appear either on the console or in a log file depending on the log configuration.

Typical use cases:


Can be used in:

serviceProxy, api, global, chainDef, for, stompProxy, if, registration, wsStompReassembler, internal, interceptor, chain, bean, transport and soapProxy

Syntax


    <log body="[false,true]" category="[string]" level="[TRACE,DEBUG,INFO,WARN,ERROR,FATAL]" />
    <log message="Path: ${path}" />

Sample

<serviceProxy port="2000">
  <request>
	<log />
  </request>
  <target host="www.predic8.de" />
</serviceProxy>

Attributes

NameRequiredDefaultDescriptionExample
level false INFO
Log level for emitted messages.

Values: TRACE, DEBUG, INFO, WARN, ERROR, FATAL


WARN
headerOnly false false
Ignored. Still there for compatibility.
-
language false SpEL
the language of the 'test' condition
SpEL, groovy, jsonpath, xpath
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"
body false true
Whether to include message bodies in logs.

Warning: Body logging can expose secrets or personal data. Prefer {@code false} in production.


-
message false - - -
category false Fully qualified class name of {@code LogInterceptor} com.predic8.membrane.core.interceptor.log.LogInterceptor
Logger category to use.

Allows routing logs into different appenders/targets via Logback/Log4j configuration.


-
maskSensitive false - Whether to mask sensitive header values (e.g., Authorization, Cookies, API keys).

When enabled (default), values are replaced by ****.


-