Skip to main content

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.

handler:
class: DebugTransformer
logFields:
- document.reference
- document.title
logLevel: INFO

Usage

Full configuration skeleton, with every option and its default
class: DebugTransformer
label: string
logContent: false
logFields:
- string
logLevel: string
prefix: string

Properties

PropertyTypeRequiredDefault
labelstringNo-
logContentbooleanNofalse
logFieldsstring[]No-
logLevelstringNo-
prefixstringNo-

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.