Name

CaptureFilter — capture request and response messages

Description

Captures request and response messages for further analysis.

Usage

{
     "name": string,
     "type": "CaptureFilter",
     "config": {
         "file": string,
         "charset": string,
         "condition": expression,
         "captureEntity": boolean
     }
}

Properties

"file": string, required

The path of the file where captured output should be written.

"charset": string, optional

The character set to encode captured output with. Default: "UTF-8".

"condition": expression, optional

The condition to evaluate to determine whether to capture an exchange. Default: unconditional.

"captureEntity": boolean, optional

Indicates that message entity should be captured. Default: true.

Examples

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",
     }
}