# Logging overview

A server that moves other people's files has to be able to say afterwards what happened. CrushMFT 27 keeps several records for that, each for a different question. This page says which is which, and where each is set up.

## The records

| Record | Answers | Kept as | Page |
|---|---|---|---|
| the **log** | what did the server do, line by line? For finding a fault. | `CrushMFT.log`, rolled daily | [The log files](Logging-Files.md) |
| **session logs** | what did this one connection do? | a file per session | [The log files](Logging-Files.md#session-logs) |
| **job logs** | what did this job run do? | a file per run | [Running, watching and stopping](Jobs-Running.md#the-log-of-a-run) |
| the **audit files** | who changed which user, and which access rule decided what? | text files in `logs/audit`, and `rbac_audit.log` | [The audit streams](Logging-Audit.md) |
| the **activity record** | what happened, as numbers and lists? For reports. | the server's own store, kept for years | [The data](Reports-Data.md) |
| **events for a SIEM** | the same happenings, in the form security tools read | sent away as they happen | [SIEM formats](Logging-SIEM.md) |

The first four are text for people. The last two are structured: every login, transfer and admin change is one entry with who, from where, what and how it ended in fields of their own.

## Where it can go

Besides its own files, the server sends its log, or the events, to other places as they happen. Each such place is a **log target**:

| Target | For | Page |
|---|---|---|
| **Syslog** | a log server or a SIEM, over UDP, TCP or TLS | [Syslog](Logging-Syslog.md) |
| **Database** | a table of a database of yours | [Logging to a database](Logging-Database.md) |
| **File** | a file of its own, for a log shipper that reads files | [SIEM formats](Logging-SIEM.md#by-file) |
| **Console** | the output of the process: what Docker and Kubernetes collect | [SIEM formats](Logging-SIEM.md#in-a-container) |

Targets are set up in [Preferences, Logging, Log Targets](Prefs-Logging-Targets.md). `CrushMFT.log` is always written as well.

## Being told

A log is read after the fact. To be told when something happens:

| | | Page |
|---|---|---|
| **Alerts** | the server sends a mail, starts a job or sends an SNMP trap when a disk runs full, an address is banned, a job fails to start … | [Alerts overview](Alerts.md) |
| **Watching a value** | an alert on any number the server knows | [Watching a variable](Alerts-Variable-Watcher.md) |
| **Report alerts** | an alert on anything in the activity record: "no upload from ACME for a day" | [Report alerts and expected files](Reports-Alerts.md) |
| **SNMP** | alerts as traps, for a network management system | [SNMP](Monitoring-SNMP.md) |

## Being watched

For a monitoring system that asks the server how it is:

| | | Page |
|---|---|---|
| **Health checks** | two addresses that say "alive" and "ready", for load balancers and orchestrators | [Health checks](Monitoring-Health.md) |
| **Metrics** | sessions, transfers, memory, queues and more as numbers, for Prometheus | [Prometheus metrics](Monitoring-Metrics.md) |

## Looking at it

| | |
|---|---|
| the log, live, in the admin pages | [Log](Admin-Log.md) |
| the server's state at a glance | [Status](Admin-Status.md), [Dashboard](Admin-Dashboard.md) |
| reports and dashboards | [Reports](Reports.md) |

## What to set up on a new server

1. **Leave the log as it is.** It rolls daily and keeps 30 days. Decide only whether 30 days is what your rules ask for: [The log files](Logging-Files.md#how-long-things-are-kept).
2. **Give the important alerts a recipient**: disk space, the server not answering, failed mail. See [Alerts overview](Alerts.md#the-ones-to-set-up-first).
3. **If you have a SIEM**: one log target in the format it reads. See [SIEM formats](Logging-SIEM.md).
4. **If you have monitoring**: the health address for the load balancer, the metrics for Prometheus.
5. **Know what the log may hold.** At a high debug level the log can hold what users sent. See [What the log may reveal](Security-Log-Privacy.md).

## Things to know

- **Time.** Every record carries the server's time. Keep the server's clock right (NTP): comparing two servers' logs depends on it.
- **A DMZ server** has a log of its own, and can pass its lines to the internal server so that both are in one place: **Send DMZ log messages to Internal server too** in [Preferences, Logging](Prefs-Logging.md#logging).
- **In a cluster** every server writes its own log. The activity record is shared: a report on any server shows all of them.
- **The log is not proof.** It is a text file that the server's account can write. For evidence that must stand up, use the activity record with its integrity chain, or events sent off the machine as they happen: [Integrity](Reports-Data.md#integrity).
