Back to Automation

What Should You Log?

What Should You Log?
AI Tutorials Team 20 April 2026

Logs exist so you can answer questions later. The questions are usually the same ones, which makes deciding what to record straightforward.

What questions will you be asked?

  • Did this item get processed? And when.
  • What did it decide? And on what basis.
  • Why did this fail? Specifically.
  • What changed? Between then and now.

What does that imply?

Logging per item rather than per run. A run-level log says two hundred items processed; an item-level log answers the question somebody is actually asking.

What should each entry contain?

An identifier for the item, what happened to it, the outcome, and the time. Those four answer most questions, and anything else is a refinement.

What about AI decisions?

Worth recording the output and, where available, the reasoning. A classification log that says which category and why is what lets you diagnose a pattern of wrong decisions.

What about the input?

A reference rather than a copy, usually. Storing the whole input duplicates data and creates obligations; storing an identifier that points at it achieves the same and less of the risk.

What about logging enough to rebuild?

A useful standard to aim at. If the logs would let somebody reconstruct what happened to any item, they contain enough, and if they would not, they are probably decorative.

That standard also keeps the volume reasonable. Logging everything is as unhelpful as logging nothing, since the relevant entry becomes impossible to find, and the reconstruction test is a good guide to the middle.

What is the personal data question?

Real and frequently overlooked. Logs containing information about identifiable people are personal data in UK terms, which brings retention limits and access obligations with it.

How long should logs be kept?

Long enough to answer questions and no longer. A defined retention period, applied automatically, is better than indefinite accumulation that nobody decided on.

What makes logs useful rather than decorative?

Being searchable by the thing you will search on. Logs you can query by item identifier answer questions in seconds; a file you scroll through does not.

What about correlating across steps?

Worth building in from the start. An identifier carried through every step means you can follow a single item's journey, which is the question you will actually want to answer.

Without it, logs are a set of disconnected events. Adding a shared identifier is trivial at design time and awkward afterwards, which makes it one of the few things worth getting right immediately.

What about logs nobody can access?

A common gap. Logs held in one person's account, or in a platform only the builder can reach, are useless during an incident when that person is unavailable.

Making them accessible to whoever might need them is part of the design rather than an afterthought. It also matters for audit purposes, where records that cannot be produced are effectively records that do not exist.

What should you not log?

Credentials, full document contents and anything sensitive you do not need. Logs are frequently the least protected place data ends up.

Real data, safe outputs, one deliberate failure, one empty run and a count that reconciles is an afternoon well spent.

What is the practical standard?

One entry per item with an identifier, outcome and timestamp, searchable, with a retention period somebody decided on. That answers the questions and limits what you are storing.