Lattice integration log cleanup
What it does. Deletes the rows of the Lattice integration logs that are older than their retention period: the service call log and its statistics, the file ingestion log, finished idempotency claims and asynchronous operations, the metadata refresh logs, closed dead letters and the business event log. Runs: automatically once a day as a background process. Who looks after it: Integration administrator (per-operation retention, and running it now with other values); System administrator (the background process itself, on a standard page).
Purpose
Every call, file, claim, dead letter and outbound event leaves a row in a Lattice log, and nothing else removes those rows. Without this cleanup the log tables grow without limit: the inquiry pages and the monitoring entities get slower, database storage grows, and data is kept far longer than anyone needs it. The cleanup also makes the per-operation retention you set on Service operation logging configuration take effect.
It deletes only rows that are finished with. Work that is still in progress (a claim being processed, a queued asynchronous operation, a dead letter that can still be retried, a failed event still waiting for its replay) is never deleted, whatever its age.
When it runs
- Once a day, at about the time of day the process was first registered; set Next execution to change it. It is one process for the whole environment: the logs are shared by every legal entity.
- The database synchronization of a Lattice deployment registers it, and process automation must be initialized in the environment. There is no batch job for you to create.
- Every poll creates a batch job named Lattice integration log cleanup; the process does not first check whether there is anything to delete.
- An Integration administrator can run the same job at any time with Clean up integration logs, with other retention values for that run.
Configuration and scheduling
| Setting | Where | Default |
|---|---|---|
| How often and when it runs | System administration > Setup > Process automations, Background processes tab: select Lattice integration log cleanup and choose Edit, then Repeat interval and Next execution on the Execution parameters tab | Once a day |
| A time of day when it does not run | The same dialog, Sleep time period group | Not set by Lattice |
| Retention of one operation's calls | System administration > Setup > Lattice > Service operation logging configuration, Retention (days) on the operation's row | 0 (use the service call log retention) |
| Run it now with other retention values | System administration > Periodic tasks > Lattice > Clean up integration logs (also in the Links of the Integration operations workspace), Retention windows group | The values in the table below |
- The background process takes no parameters: it always uses the default retention of each log in the table below. Only Retention (days) on Service operation logging configuration changes what it does, because the cleanup reads that page's rows on every run.
- The fields of Clean up integration logs apply only to the run you start there. A value of 0 does not mean "keep forever": it deletes every row of that log that the status rules allow. The dialog does not check the values, so read them before you click OK.
- The dialog can also schedule its run as a batch job. Do not do that: the background process always runs, and two cleanups with different values make the retention you actually get hard to predict. To choose when it runs, set Next execution in Edit.
- A deployment keeps the interval, next execution and owner you set. The process cannot be switched off; to keep it out of busy hours, set Enabled sleep period or Next execution in Edit.
- Process automations is a standard page that only the System administrator role opens. Clean up integration logs and Service operation logging configuration need the Integration administrator role.
How it works
The cleanup works through the logs one at a time. Each log is deleted in its own transaction, so a failure on one log is reported and the cleanup carries on with the next.
| Log | Field in Clean up integration logs | Default retention | Age measured from | Rows deleted |
|---|---|---|---|---|
| Service call log | Service call log (days) | 90 days, or the operation's own Retention (days) when it is above 0 | The call's start time | All rows past the retention |
| Service call statistics | The same Service call log (days) | 90 days | The row's Date | All rows past the retention. An operation's own Retention (days) does not apply here |
| File ingestion log | File ingestion log (days) | 90 days | When the row was written | All rows past the retention |
| Idempotency log | Idempotency log (days) | 30 days | When the claim completed | Only claims with status Succeeded |
| Async operation tracking | Async operation tracking (days) | 30 days | When the operation was submitted | Only operations with status Succeeded or Failed |
| Service metadata refresh log | Service metadata refresh log (days) | 90 days | When the row was written | All rows past the retention |
| OData refresh log | OData refresh log (days) | 90 days | When the row was written | All rows past the retention |
| Dead-letter queue | Dead-letter queue (days) | 90 days | The item's last attempt | Only items with status Reprocessed or Discarded, with their payloads |
| Business event log | Business event log (days) | 90 days | When the event was logged | Success rows, and Error rows whose reconciliation state is Resolved, Exhausted, Manual intervention required or Dismissed |
Kept whatever their age: idempotency claims in any status other than Succeeded; asynchronous operations that are Queued or Processing; dead letters that are Retrying, Parked, Held or Requeued; and Error rows of the business event log that are Not reconciled.
For the service call log, the operations that have a Retention (days) above 0 on Service operation logging configuration are cleaned first, each on its own retention (shorter or longer than the default). Every other operation uses Service call log (days).
At the end the run reports how many rows it deleted from each log.
Before it can run
- Process automation is initialized in the environment (System administration > Setup > Initialize process automations), Lattice was deployed with a database synchronization, which registers the process (a synchronization from Visual Studio registers nothing), and the batch service is running.
- Nothing else: there is no setup row, and a license warning or block does not stop it.
Inputs and outputs
| Log | Where you see it |
|---|---|
| Service call log | System administration > Inquiries > Lattice > Services > Service call log, LatticeServiceCallLogs |
| Service call statistics | Service call statistics, LatticeServiceCallStatistics |
| File ingestion log | File ingestion operations workspace, Ingestion log tab; LatticeFileIngestLogs |
| Idempotency log | Service idempotency log, LatticeServiceIdempotencyLogs |
| Async operation tracking | LatticeAsyncOperationTrackingRecords |
| Service metadata refresh log | Service metadata refresh log, from the Service metadata explorer |
| OData refresh log | OData entity metadata explorer |
| Dead-letter queue | Integration operations console, LatticeIntegrationDeadLetters, LatticeIntegrationDeadLetterPayloads |
| Business event log | System administration > Inquiries > Lattice business events > Business event log, LatticeBusinessEventLogs |
The cleanup only deletes. It writes no row, raises no business event and changes no business data.
Monitoring and logs
- System administration > Setup > Process automations, Background processes tab: select the process and choose View most recent results. Each run shows "Lattice integration log cleanup finished.", or "Lattice integration log cleanup failed. The messages below give the reason; the process runs again at its next interval." with the messages.
- System administration > Inquiries > Batch jobs: the batch job named Lattice integration log cleanup. Its log holds the counts: "Lattice integration log cleanup completed (rows deleted). Service call log: %1, service call statistics: %2, file ingestion log: %3, idempotency log: %4, async operation tracking: %5, service metadata refresh log: %6, OData refresh log: %7, dead-letter queue: %8, business event log: %9." with the numbers in place of %1 to %9.
- On the pages above, the oldest row is no older than the retention, apart from the rows the status rules keep.
When it fails
A log that cannot be cleaned is rolled back on its own, counted as 0 in the final message, and reported in the batch job's log as "Integration log cleanup failed while purging %1: %2", where %1 names the log's table and %2 gives the reason. The other logs are still cleaned. Because these errors are handled inside the job, View most recent results still records the run as finished, so read the batch job's log when a log keeps growing. The batch framework does not retry the run; the next daily run tries again.
| Symptom | Cause | Fix |
|---|---|---|
| The logs keep growing | The process is not running (process automation not initialized, Lattice deployed without the database synchronization that registers its processes, or the batch service stopped) | Check the process on Process automations and its batch jobs |
| One log keeps growing while the others shrink | That log's delete fails on every run | Read "Integration log cleanup failed while purging ..." in the batch job's log and fix the reason |
| An old dead letter, claim, asynchronous operation or event row is still there | Its status is not one the cleanup deletes | Expected: finish it first (for example discard the dead letter); the cleanup removes it once the retention has passed after that |
| One operation's calls disappear sooner than 90 days | Its Retention (days) on Service operation logging configuration is shorter | Raise it, or set it to 0 to use the default |
| Far more rows than expected were deleted | Someone ran Clean up integration logs with small values, or 0 | The rows cannot be brought back; next time check the values before clicking OK |
Effect on the rest of Lattice
- Once a row is deleted, you can no longer trace that call, file, claim or event on the Lattice pages or entities. Export what you must keep for longer (for example for an audit) before it ages out.
- Duplicate protection lasts as long as the claim. A request whose Succeeded idempotency claim has been deleted (30 days after it completed, by default) is no longer recognized as a repeat: sent again with the same request ID, it runs again.
- Service call statistics are deleted after 90 days whatever an operation's own retention. But the statistics rollup rebuilds the last 30 days from the call log on every run, so an operation whose Retention (days) is under 30 keeps statistics only for the days its calls survive in the log.
- The rows the status rules keep are the ones the other background processes still work on: the dead-letter retry, the idempotency reconciliation, the business event reconciliation and Lattice Async Operation Processing. The cleanup never takes their work away.
- The deletes are set-based. On a large backlog (for example the first run after a long time without one) a run can take a while; move Next execution to a quiet hour if it competes with daytime work.
Related
- I want to set how much each service operation logs
- I want to check that the Lattice background processes are running
- I want to read the integration logs from my own reporting tool
- Review access and activity
- Log retention and cleanup
- Tuning how much an operation logs
- Lattice service call statistics rollup
- Lattice file ingestion cleanup