File listener error handling and debugging
Learn about the processing that occurs at run time when requestors that are based on the file listener encounter errors. For example, you can configure the number of recovery attempts, whether to rename or delete files with errors, and specify the file extension to append to renamed files.
For more information, see Configuring file listener error recovery.
You can use the Log-Service-File class to debug Service File configurations. The Log-Service-File class records the processing of a listener in the Pega Platform database for reporting and debugging. Select Persist Log-Service-File instances? on the Process tab of the File Listener to save this information. For more information, see Configuring file listener processing.
When the system calls the service activity after your file is processed, the file listener creates a top-level page called LogServiceFile of class Log-Service-File on the clipboard. You can use the information in the LogServiceFile page if you need to write a custom service activity.
The information on the LogServiceFile page includes the following general metadata:
- pyListenerName – Name of the listener that is processing the file.
- pyServerName – Host name of the server that processed the file.
- pyRequestorId – Requester that is used to run the file processing activity.
- pyOriginalDirectory – Name of the original parent directory. The name remains constant through any recovery attempts.
- pyOriginalFilename – Name of the original file. If the Log-Service-File entry describes a recovery attempt, the original file name is different from the pyFileName property.
- pyOriginalFileId – Internally used parameter that enables recovery. Do not use this parameter because its usage might change.
- pyPathName – Full path name of the file.
- pyFileName – Name of the file, not including path information.
- pyWorkFileName – Set to the completed file name when the file is processed. You can also use pyFileName, pyOriginalFileName, pyPathName, and pyOriginalDirectory.
- pyUniqueId – Internally used parameter that enables recovery. Do not use this parameter because its usage might change.
- pyFileLastModified – Date and time that the file reports were last modified.
- pyFileLength – Length of the file, in bytes.
- pyBatchesinFile – The number of batches in the file, which is equal to the number of queued batches plus the number of completed batches.
The information saved includes the following processing statuses:
- pyDateTime – Date and time that processing started.
- pyMessage – If an error occurs during processing, specifies the error message.
- pyProcessingStatus – Status of processing for this file.
- pyProcessingComplete – Indicates whether processing is complete for this file.
- pyBytesProcessed – Number of bytes processed in the file.
- pyQueuedBatches – Number of queued batches. Unless the file was marked as complete, this is a running count that should not be considered final (except when the listener cannot pick up the file again for continued processing).
- pyCompletedBatches – Number of batches that have completed. Unless the file was marked as complete, this is a running count that should not be considered final (except when the listener cannot pick up the file again for continued processing).
- pyFirstBatchQueuedTime – The time that the first batch was queued.
- pyFirstBatchCompletedTime – The time that the first batch was completed.
- pyLastBatchQueuedTime – The time that the last batch was queued.
- pyLastBatchCompletedTime – The time that the last batch was completed.
- pyReportFileName – The name of the file that contains processing results.
- pyTransactionCount – Number of transactions processed in this file. Unless the file was marked as complete, this is a running count that should not be considered final (except when the listener cannot pick up the file again for continued processing).
- pyTransactionErrorCount – Number of transactions in error. Unless the file was marked as complete, this is a running count that should not be considered final (except when the listener cannot pick up the file again for continued processing).
- pyStackTrace – On error, the associated stack trace. If there was more than one error, indicates the most recent stack trace.
In addition to the above debugging information, you can use remote logging to debug file listeners. For more information, see Debugging listeners by using remote logging.
- Configuring file listener error recovery
You can automate how your file listener recovers files if an error occurs. In the file listener rule form, specify the processing that occurs at run time when requestors that are based on the file listener encounter errors. For example, you can rename files with the file extension .err so that you can easily identify the files that the file listener could not process.
Previous topic Configuring file listener processing Next topic Configuring file listener error recovery