# What never reaches a log

Logs are read by many: support staff, auditors, a monitoring system, the people a log bundle is mailed to. A log that holds passwords turns every one of them into somebody who has those passwords. The server therefore keeps secrets out of what it writes, and masks them where a line would otherwise carry them.

## What is masked

| Secret | In the log |
|---|---|
| a password typed at login, on any protocol | never written |
| the password in an address, as in `sftp://user:password@host/` | shown as `sftp://user:****@host/` |
| the login header of a web request | `Authorization: Basic ***************` |
| session cookies | `CrushAuth=*******` |
| the token against forged requests, `c2f` | masked wherever a request is written |
| the secret of an access token | never stored readable, never written |
| the access key of an S3 request, which holds a password | masked |
| the secret key of the server | never written |

On the test server, after a day of logins over the web, SFTP, FTP and S3 with three accounts, a search of the whole server log for their passwords found nothing.

What **is** written, on purpose: who logged in, from which address, over which protocol, when, what they did to which file, and what failed. That is what a log is for.

## Where secrets are shown, and to whom

| Place | A full administrator | A role holder, a token |
|---|---|---|
| a user's password, when it is stored readable instead of hashed | can read it | gets it masked |
| passwords of folders, jobs, the mail server | can read them | masked |
| reading the server log through the API | cookies, `c2f` values and token secrets are masked again on the way out | the same |
| the list of sessions | never shows session tokens | the same |

A hashed password can be read by nobody. See [Passwords and password rules](Security-Passwords.md).

## The exception: debug logging

The server log has levels. At the normal level, 0, everything above holds. At **level 2**, a level for finding faults, the server writes every admin request whole, as it arrived. A request that saves a user carries that user's new password; a request that saves the mail settings carries the mail password.

> [!WARNING]
> At log level 2, the server log holds secrets. Raise the level only while you look for a fault, lower it again the same day, and treat the log of that time as you would a password file.

The level is set in [Logging](Prefs-Logging.md). Session logs of single users and the logs of jobs have their own switches there.

## Other places a secret can hide

Masking covers what the server knows to be a secret. It cannot know everything:

- **File names.** `passwords-2026.xlsx` and `contract-acme-takeover.pdf` are in the log because transfers are. Tell users that names are not private.
- **Job logs.** A job that prints a variable prints what is in it. Do not log variables that hold secrets, and turn a job's debug logging off after use.
- **Custom scripts and plugins** write what their author made them write.
- **Mail templates** and alerts send what you put into them. `{user_pass}` in a welcome mail is a password in a mailbox.
- **Notes** on users and comments on listeners are shown to everybody who may see them.

## Keeping logs well

| Do | Why |
|---|---|
| keep the logs folder readable for the server's account and for administrators only | logs are a record of who has which files |
| give the role **Log Reader** deliberately | reading logs is a sensitive right of its own |
| decide how long logs are kept, and delete older ones | [Logging](Prefs-Logging.md); less kept is less to lose |
| send logs to a central system over an encrypted link | [Log targets](Prefs-Logging-Targets.md) |
| look into a log before you mail it to anybody | once, with a search for anything that looks like a secret |

## Before you send a log to support

The **About** page of Server Admin can send debug data to the vendor: see [About](Admin-About.md). It sends settings and logs. If the log level was at 2 during the time the log covers, say so, or cut that part out first.

## The audit log

Beside the server log there is the access audit log: who was given which role, who issued and used which token, which admin action was refused. It holds no secrets by design, and only full administrators and the role **Auditor** may read it. See [Roles and access](Security-Roles.md).
