---
title: "Logs · Agent Wranglers"
url: https://agentwranglers.se/playbook/operations/logs
updated: 2026-10-20
licence: "All rights reserved"
---

# Logs

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

> Write one structured line per event, tie it to the request that caused it, and keep personal data out. Then logs answer questions instead of hiding them.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers operations playbook: https://agentwranglers.se/playbook/operations/logs`.

## Required

- [Log structured events](https://agentwranglers.se/playbook/operations/logs/structured-logs): Write each log entry as one line of structured data, such as JSON, with a time, a level, an event name and its fields.
- [Tie every line to its request](https://agentwranglers.se/playbook/operations/logs/request-ids): Give every request an ID, pass it to every service it touches, and write it on every log line and error page.
- [Keep personal data out of logs](https://agentwranglers.se/playbook/operations/logs/logs-without-personal-data): Never log passwords, tokens, full card numbers or personal details. Log IDs instead.
- [Keep logs for a fixed time](https://agentwranglers.se/playbook/operations/logs/log-retention): Keep logs only as long as you need them, delete them on a schedule, and say how long in the privacy policy.

## Recommended

- [Use log levels with fixed meanings](https://agentwranglers.se/playbook/operations/logs/log-levels): Use a small set of levels, each with one meaning, and run production at info level.

- Previous: [Service levels](https://agentwranglers.se/playbook/operations/service-levels)
- Next: [Metrics and traces](https://agentwranglers.se/playbook/operations/metrics-and-traces)
- [All chapters](https://agentwranglers.se/playbook/operations)
