Skip to main content

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​

SettingWhereDefault
How often and when it runsSystem 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 tabOnce a day
A time of day when it does not runThe same dialog, Sleep time period groupNot set by Lattice
Retention of one operation's callsSystem administration > Setup > Lattice > Service operation logging configuration, Retention (days) on the operation's row0 (use the service call log retention)
Run it now with other retention valuesSystem administration > Periodic tasks > Lattice > Clean up integration logs (also in the Links of the Integration operations workspace), Retention windows groupThe 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.

LogField in Clean up integration logsDefault retentionAge measured fromRows deleted
Service call logService call log (days)90 days, or the operation's own Retention (days) when it is above 0The call's start timeAll rows past the retention
Service call statisticsThe same Service call log (days)90 daysThe row's DateAll rows past the retention. An operation's own Retention (days) does not apply here
File ingestion logFile ingestion log (days)90 daysWhen the row was writtenAll rows past the retention
Idempotency logIdempotency log (days)30 daysWhen the claim completedOnly claims with status Succeeded
Async operation trackingAsync operation tracking (days)30 daysWhen the operation was submittedOnly operations with status Succeeded or Failed
Service metadata refresh logService metadata refresh log (days)90 daysWhen the row was writtenAll rows past the retention
OData refresh logOData refresh log (days)90 daysWhen the row was writtenAll rows past the retention
Dead-letter queueDead-letter queue (days)90 daysThe item's last attemptOnly items with status Reprocessed or Discarded, with their payloads
Business event logBusiness event log (days)90 daysWhen the event was loggedSuccess 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​

LogWhere you see it
Service call logSystem administration > Inquiries > Lattice > Services > Service call log, LatticeServiceCallLogs
Service call statisticsService call statistics, LatticeServiceCallStatistics
File ingestion logFile ingestion operations workspace, Ingestion log tab; LatticeFileIngestLogs
Idempotency logService idempotency log, LatticeServiceIdempotencyLogs
Async operation trackingLatticeAsyncOperationTrackingRecords
Service metadata refresh logService metadata refresh log, from the Service metadata explorer
OData refresh logOData entity metadata explorer
Dead-letter queueIntegration operations console, LatticeIntegrationDeadLetters, LatticeIntegrationDeadLetterPayloads
Business event logSystem 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.

SymptomCauseFix
The logs keep growingThe 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 shrinkThat log's delete fails on every runRead "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 thereIts status is not one the cleanup deletesExpected: 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 daysIts Retention (days) on Service operation logging configuration is shorterRaise it, or set it to 0 to use the default
Far more rows than expected were deletedSomeone ran Clean up integration logs with small values, or 0The 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.