Logs
Bookkeepers need to review exported expenses, see their details and resolve export issues when they occur. To support this, your integration must save information about every Export Job and every Export Item within it. It must also let users download that information as a file.What the Log File Contains
The downloaded file must contain the following information. Context- A snapshot of the configuration parameters and their values at the time of download. See User-Facing Configurations.
- The Accounting System version, if it applies.
- The connected Pleo entity, with its
company_id. - The connected company in the Accounting System.
For each Export Item in the Export Job, include at least these fields.
Other logs
Record each of the following operations with a timestamp and a success status.
- Token refresh operations
- Tags sync operations
- Tax Codes sync operations
- Accounts sync operations
- Vendor sync operations
Retention
Keep each log for 30 days. Delete any log that is older than 30 days automatically.Where the Data Comes From
Most of the Export Job and Export Item fields come from the values your integration already sends when it updates statuses. Use the samefailureReason and failureReasonType values you report to Pleo, so the log and Pleo always agree. See Update Export Items for the values.
Related Logging Guidance
The export log file above is the log that your integration must let users download. Other pages describe how to log specific operations, and what you must never log. Use them as guidance when you record the “Other logs”. They do not add fields to the export log file.Never Log Credentials
Do not write tokens or full API Keys to logs, error messages or debug output. If you need an identifier for debugging, keep at most the last 4 characters of an API Key.- Secure Token Storage: avoid logging tokens or including them in error messages.
- Security and Credential Management for Standalone API Keys: see “Logging and Monitoring”.
- Security and Credential Management for Integrated API Keys: see “Logging and Monitoring”.
Token Refresh and Authentication
- How to Refresh Tokens: log each refresh attempt with a timestamp, the outcome and the failure reason where available.
- How to Handle Token Expiry or Revocation: log refresh failures, the detection of expiry or revocation, and reauthentication triggers.
- Race Condition Prevention: track refresh attempts, lock waits and failures.
- How to Call Pleo APIs Using an Access Token: log authentication failures with enough context to troubleshoot.
Sync Operations
- Vendor Sync Workflow Guide: add a sync-run ID to every log line, log how many Vendors you created, updated, unarchived and archived, and keep an audit trail for each write.
- Vendor Creation Workflow Guide: use one correlation ID for each Vendor, and log the detection, the creation attempt and the activation.
- Sync Vendors: log and skip Vendors with an empty or duplicate
externalId. - Vendor Sync Data Mapping: log invalid
countryordefaultCurrencyvalues for investigation. - How to Handle a High-Volume Chart of Accounts: log rejected batches and the items in the
failedarray.
Export Processing
- Attachment Handling: log every failed attachment, and never drop one silently.