> For the complete documentation index, see [llms.txt](https://ispectra.gitbook.io/mutamad/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ispectra.gitbook.io/mutamad/reference/projects/mutamad_logging.md). Agents can also search and read this documentation through its [MCP server](https://ispectra.gitbook.io/mutamad/~gitbook/mcp).

# Mutamad Logging

Security event logging for Mutamad: every log entry to syslog as structured JSON for a SIEM, and scheduled tasks that run on time.

{% hint style="info" %}
**Machine name:** `mutamad_logging` · **Type:** General project · **In Mutamad:** Applied on every Mutamad site
{% endhint %}

Security event logging for a Mutamad site, and scheduled tasks that run on time:

* every log entry sent to syslog as one JSON object (message, level, channel, time, user, IP address, URL), for a SIEM
* a larger database log, 100,000 entries instead of 1,000, read and cleared only by the site administrator
* revisions compared field by field
* each cron task a job of its own with Ultimate Cron, every 15 minutes at its own minute, with 30 days of runs logged
* Automated Cron off, so tasks do not wait for a visitor: the server runs cron, and the status report warns after an hour without it

Cron is where a site checks for security updates, expires passwords, trims the log, sends newsletters and updates the search index: when it stops, those controls stop. Aligned to NCA ECC-2:2024 2-12 (event logs).

<figure><img src="https://171036656-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQSekKpxOCXC1q6G2NRy9%2Fuploads%2Fgit-blob-e54d7650317c14461b9fffdc9f0507632a734de2%2Fcron-en.jpg?alt=media" alt="Ultimate Cron: each cron task a job of its own, with when it last ran."><figcaption><p>Ultimate Cron: each cron task a job of its own, with when it last ran.</p></figcaption></figure>

## Requirements

* Drupal 11.4
* [Diff](https://www.drupal.org/project/diff)
* [Monolog](https://www.drupal.org/project/monolog)
* [Ultimate Cron](https://www.drupal.org/project/ultimate_cron)
* a server that runs `drush cron`

## Installation

Mutamad is in alpha. A site started from the [Mutamad project template](https://www.drupal.org/project/mutamad_project) is ready for it; on any other Drupal 11.4 site, allow alpha releases first:

```bash
composer config minimum-stability alpha
composer config prefer-stable true
```

```bash
composer require drupal/mutamad_logging
drush recipe ../recipes/mutamad_logging
```

Then run cron from the server every minute, for example with this crontab line:

```bash
* * * * * cd /var/www/example.gov.sa && vendor/bin/drush cron --quiet
```

## Links

* [Project page on drupal.org](https://www.drupal.org/project/mutamad_logging)
* [README](https://git.drupalcode.org/project/mutamad_logging/-/blob/1.0.x/README.md): every setting, and why
* [Changelog](https://git.drupalcode.org/project/mutamad_logging/-/blob/1.0.x/CHANGELOG.md)
* [Issue queue](https://www.drupal.org/project/issues/mutamad_logging)
