DebugTransformer
Logs document details for debugging during processing.
Notes
This functionality help with troubleshooting of document importing. Place this transformer anywhere in your handler configuration to print to the log stream the metadata fields or content so far when this handler gets invoked. This handler does not impact the data being imported at all (it only reads it).
The default behavior logs all metadata fields using the DEBUG log level. You can optionally set which fields to log and whether to also log the document content or not, as well as specifying a different log level.
Be careful: Logging the content when you deal with very large content can result in memory exceptions.
Parser Handler Compatibility
This functionality can be applied as either a pre-parse or post-parse handler.
Examples
The following logs the value of any document.reference and document.title document metadata fields.
- YAML
- JSON
- XML
handler:
class: DebugTransformer
logFields:
- document.reference
- document.title
logLevel: INFO
{
"handler": {
"class": "DebugTransformer",
"logFields": [
"document.reference",
"document.title"
],
"logLevel": "INFO"
}
}
<handler>
<class>DebugTransformer</class>
<logFields>
<logField>document.reference</logField>
<logField>document.title</logField>
</logFields>
<logLevel>INFO</logLevel>
</handler>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: DebugTransformer
label: string
logContent: false
logFields:
- string
logLevel: string
prefix: string
{
"class": "DebugTransformer",
"label": "string",
"logContent": false,
"logFields": [
"string"
],
"logLevel": "string",
"prefix": "string"
}
<handler>
<class>DebugTransformer</class>
<label>string</label>
<logContent>false</logContent>
<logFields>
<logField>string</logField>
</logFields>
<logLevel>string</logLevel>
<prefix>string</prefix>
</handler>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
label | string | No | - |
logContent | boolean | No | false |
logFields | string[] | No | - |
logLevel | string | No | - |
prefix | string | No | - |
Property Details
label
An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing — it exists purely to help identify this step, for example in large configurations or in the visual configurator.
logContent
Be careful: Logging the content when you deal with very large content can result in memory exceptions.
logFields
Logs the document's metadata fields for debugging.
logLevel
Specifies the logging level.
prefix
Adds a custom prefix to log messages for identification.