enabled | Whether request logging is enabled. | boolean | false |
logQueryParams | Whether to include query parameters in the logs. If disabled, these will be stripped from the request URLs logged. | boolean | true |
logRequestHeaders | Whether to include request headers in the logs. Default masking for common sensitive headers (e.g. Authorization) applies. | boolean | false |
logRequestBody | Whether to include the request body in the logs. Only JSON and text are supported, up to 50 KB. | boolean | false |
logResponseHeaders | Whether to include response headers in the logs. | boolean | true |
logResponseBody | Whether to include the response body in the logs. Only JSON and text are supported, up to 50 KB. | boolean | false |
logException | Whether to include exception details in the logs. | boolean | true |
captureLogs | Whether to capture application logs emitted during request handling. | boolean | false |
maskQueryParams | Array of regular expressions for matching query parameters to mask. These are in addition to the default masking patterns. | RegExp[] | [] |
maskHeaders | Array of regular expressions for matching headers to mask. These are in addition to the default masking patterns. | RegExp[] | [] |
maskBodyFields | Array of regular expressions for matching request/response body fields to mask. These are in addition to the default masking patterns. | RegExp[] | [] |
maskRequestBodyCallback | Callback function for masking the request body. Takes one parameter request and returns the request body as Buffer or null. | Function | - |
maskResponseBodyCallback | Callback function for masking the response body. Takes two parameters request and response and returns the response body as Buffer or null. | Function | - |
excludePaths | Array of regular expressions for matching paths to exclude from logging. | RegExp[] | [] |
excludeCallback | Callback function for excluding requests from logging. Takes two parameters request and response and returns true, if the request should be excluded, or false otherwise. | Function | - |