When something fails, logs are often the only record of what happened. An agent that debugs from logs needs the same things a person does.
What good logs have
- Structure: one event per line in a consistent format, such as JSON.
- Levels: error, warn, info, debug, used consistently.
- Context: request id, user or tenant id, the operation and its outcome.
- Time in UTC with a time zone, to the millisecond.
- Errors with causes: the message and the stack, not only “failed”.
What to leave out
- Passwords, tokens, keys and other secrets.
- Personal data you do not need. Log an id, not an email address.
- Whole request bodies by default.
Make them easy to hand over
- When you give logs to an agent, include only the relevant time window.
- Large logs cost tokens on every turn. See context size and token cost.
- Redact before sharing.
Contextingo’s own rule is the same: never put secrets in logs or audit data.