Logs and error references
This page is for the operator who reads Adiutor’s logs. It covers what Adiutor writes, why the logs count as personal data, and how to find what happened behind the reference an error page shows.
What Adiutor logs
Section titled “What Adiutor logs”The server and the commands write to standard output and standard error. Where that goes depends on how you run it:
- Docker Compose:
docker compose logs appanddocker compose logs jobs. - A systemd service:
journalctl -u adiutor, andjournalctl -u adiutor-jobsfor the jobs run by a systemd timer. - The jobs run by cron: wherever the cron line sends the output, such as
/var/log/adiutor-jobs.log.
In the Docker image, the jobs’ tick and the other commands that look for a .env file start with the line .env not found. Continuing without it. That’s harmless: the settings come from the container’s environment instead.
Successful requests log nothing that identifies anyone. Before anything is written, Adiutor takes database values out of it:
- A failed query is logged with its SQL, its SQL state and the constraint, and Next.js’s digest of the error. The values it was sent are replaced by
params: [redacted]. - PostgreSQL’s
detailline, such as which key and value clashed, is left out. - What PostgreSQL quotes in its own message is replaced too, except the name of the constraint, table, column, schema or data type the error is about.
This covers Next.js’s own logging, the sign-in library’s and Adiutor’s messages. Other text stays: an error’s message can still hold, for example, the address a mail server refused.
The health check’s log line says why the app is unhealthy, as the migration state or an error code, never connection details. When there’s no mail server in development, emails are printed in full so their links can be opened. That never happens in production.
Logs are personal data
Section titled “Logs are personal data”Errors can name people: an address an email failed for, a user’s name. Treat the app’s output and the jobs log as personal data.
- Let only the people who run the server read them, not the whole team or a public dashboard.
- Keep them about 30 days:
logrotatefor a log file, your platform’s retention setting, or Docker’s log options (max-sizeandmax-file; without them, Docker keeps every line). - Mention them in your privacy notice: what’s logged on errors, why and for how long.
Looking up an error reference
Section titled “Looking up an error reference”When something fails unexpectedly, Adiutor’s error pages show a reference such as 7KQ2-M9XD and the time. The sign-in error page shows one too. Users can copy it and send it to a staff Admin. There are three places to look it up.
In the app. A staff Admin opens Logs › Errors (/admin/logs/errors), types the reference in Look up a reference (capitals and the dash don’t matter) and sees everything stored under it. The page also lists the errors of the last 7 days. See Logs.
In the server log. Search for the reference. Each error logs one line with the reference and where it happened:
App error TXCY-X79D: server render /(app)/companies/page (digest 2828711936)Search the log for the digest to find Next.js’s own line with the stack. Sign-in errors log the reference and the code:
Sign-in error 7KQ2-M9XD: state_mismatchIn the database, for 7 days, through app_error or sign_in_error:
select created_at, source, route_type, route_path, path, name, message, user_idfrom app_error where reference = 'TXCY-X79D' order by created_at desc;The same server error happening again is stored again under the same reference, so the query can return several rows.
Errors are kept 7 days in the app and the database, and at most 20 an hour per address are stored, so that opening an error page over and over can’t fill the table. Past that, or after 7 days, only the server log has them. What is stored, and what isn’t, is in Security.
Example
Section titled “Example”A user at Adiutor Alpha sends Alex Admin the reference 7KQ2-M9XD from a failed sign-in. Alex looks it up in Logs › Errors and sees the code, state_mismatch: the sign-in took too long, or was started in another tab, so the user only needs to try again. A search of the server log for the same reference finds the matching line with the time.
Good to know
Section titled “Good to know”- A job’s failure has a reference too: look it up the same way.
- References never contain anything about the person.
Related
Section titled “Related”Adiutor's code is released under the MIT License. The Adiutor name and logo aren’t covered by it; see the notice.
Set in Inter and JetBrains Mono, under the SIL Open Font License (Inter, JetBrains Mono).