CaptureFilter — capture request and response messages
{
"name": string,
"type": "CaptureFilter",
"config": {
"file": string,
"charset": string,
"condition": expression,
"captureEntity": boolean
}
}"file": string, requiredThe path of the file where captured output should be written.
"charset": string, optionalThe character set to encode captured output with. Default:
"UTF-8".
"condition": expression,
optionalThe condition to evaluate to determine whether to capture an exchange. Default: unconditional.
"captureEntity": boolean,
optionalIndicates that message entity should be captured. Default:
true.
Log the entire request and response:
{
"name": "LogToTemporaryFile",
"type": "CaptureFilter",
"config": {
"file": "/tmp/gateway.log",
}
}Log the request and response. Do not log the entity:
{
"name": "LogToTemporaryFile",
"type": "CaptureFilter",
"config": {
"file": "/tmp/gateway.log"
"captureEntity": false,
}
}Normal usage of the CaptureFilter is to create an OutgoingChain. This enables you to call filters like the CaptureFilter, before sending out the request:
{
"name": "OutgoingChain",
"type": "Chain",
"config": {
"filters": [ "LogToTemporaryFile" ],
"handler": "ClientHandler"
}
},
{
"name": "LogToTemporaryFile",
"type": "CaptureFilter",
"config": {
"captureEntity": false,
"file": "/tmp/gateway.log",
}
}