PADFoundationloggingaudittroubleshootingfoundationstructured-logging
Log Detail Writer
Appends a timestamped, leveled log entry to the in-memory log list and optionally writes to a log file. Supports INFO, WARN, and ERROR levels with consistent formatting. Use throughout your flow for structured operational logging.
0 copies
Section 1: Initialize Log Infrastructure
Section 2: Format and Append Log Entry
Section 3: Optional File Output
Usage Notes
- Set
strLogLeveltoINFO,WARN, orERRORbefore each call to control the severity tag in the formatted output - Set
strLogMessageto describe the current operation (e.g.,$'''Processing invoice 1042''') before each call strRunIdties every log line back to the current execution — use the value generated by Variable BootstraplstLogEntriesaccumulates all entries in memory; use it at the end of the flow to write a complete log or send via email- Each formatted entry follows the pattern:
[2026-03-20 14:30:22.150] [INFO] [RUN-20260320-143022] Processing invoice 1042 - The optional file output (Section 3) appends to a CSV file when
strLogFilePathis set to a valid path — leave as(none)to skip file writes - For high-volume flows, consider writing to file periodically rather than only keeping entries in memory
- To use this as a reusable subflow, wrap it in a
FUNCTION Subflow_LogDetailWriter GLOBALblock
Requirements
lstLogEntrieslist variable must be initialized (Section 1 handles this, or use Variable Bootstrap)strRunIdshould be set by the Variable Bootstrap pattern before first use- If file output is enabled, the target directory must exist and the flow must have write permissions
- File.WriteToCSVFile action requires PAD file system actions (included in all PAD versions)
- No external dependencies — uses only built-in PAD actions