PHPackages                             os2web/os2web\_audit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. os2web/os2web\_audit

ActiveDrupal-module[Logging &amp; Monitoring](/categories/logging)

os2web/os2web\_audit
====================

Drupal OS2 module that provides audit logging for Danish Municipalities

1.2.0(1y ago)014.2k↓51.8%24EUPL-1.2PHPPHP ^8.1

Since Aug 20Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/OS2web/os2web_audit)[ Packagist](https://packagist.org/packages/os2web/os2web_audit)[ RSS](/packages/os2web-os2web-audit/feed)WikiDiscussions develop Synced 3d ago

READMEChangelog (10)Dependencies (8)Versions (19)Used By (4)

OS2Web Audit
============

[](#os2web-audit)

This audit module can be used to track changes and perform audit logging on drupal sites.

Features
--------

[](#features)

This module includes three plugins that facilitate logging information to Loki, files, or to the database through Drupal's watchdog logger.

These logging providers are designed using Drupal's plugin APIs. Consequently, it opens up possibilities for creating new AuditLogger plugins within other modules, thus enhancing the functionality of this audit logging.

For performance purposes we use a queue system. This avoids hindering performance more than necessary as the actual logging is done async. Furthermore, this allows for retries in case any audit log plugins should fail.

Installation
------------

[](#installation)

Enable the module and go to the modules setting page at `/admin/config/os2web_audit/settings/`.

```
composer require os2web/os2web_audit
drush pm:enable os2web_audit
```

Drush
-----

[](#drush)

### Test audit log

[](#test-audit-log)

The module provides a Drush command named audit:log. This command enables you to log a test message to the configured logger. The audit:log command accepts a string that represents the message to be logged.

The message provided, will be logged twice, once as an informational message and once as an error message.

```
drush audit:log 'This is a test message'
```

### Retry jobs

[](#retry-jobs)

The module also comes with methods for retrying failed jobs in the `os2web_audit` queue.

```
drush audit:retry-failed-jobs
```

Per default, it simply retries all failed jobs however it comes with the following options:

```
 --id[=ID]       Retry a specific job by ID (e.g. 1245.)
 --ignore-state  Retry job regardless of state. This only effects the --id option.
 --limit[=LIMIT] Retry (up to) a limited number of jobs. Minimum: 1, Maximum: 5000, Default 1000.
```

Usage
-----

[](#usage)

The module exposes a simple `Logger` service which can log an `info` and `error`messages.

Inject the logger service named `os2web_audit.logger` and send messages into the logger as shown below:

```
$msg = sprintf('Fetch personal data from service with parameter: %s', $param);
$this->auditLogger->info('Lookup', $msg);
```

### Implementations

[](#implementations)

See [implementations](/docs/IMPLEMENTATIONS.md) for a list of modules that have audit logging integrated.

Queue
-----

[](#queue)

The actual logging is handled by jobs in an [Advanced Queue](https://www.drupal.org/project/advancedqueue) queue.

The queue, OS2Web audit (`os2web_audit`), must be processed by a server `cron` job, e.g.

```
drush advancedqueue:queue:process os2web_audit
```

List the queue (and all other queues) with

```
drush advancedqueue:queue:list
```

or go to `/admin/config/system/queues/jobs/os2web_audit` for a graphical overview of jobs in the queue.

### Purge successful jobs

[](#purge-successful-jobs)

It is possible to configure the queue to purge jobs based on the number of jobs or the number of days since processing.

Go to `admin/config/system/queues/manage/os2web_audit` to configure this.

Below is an example of purging successful jobs after 7 days.

[![queue purge config](/docs/queue_purge_config.png)](/docs/queue_purge_config.png)

Remember to export this to ensure it is not overridden upon config import.

Coding standards
----------------

[](#coding-standards)

### PHP files (PHP\_CodeSniffer)

[](#php-files-php_codesniffer)

Check PHP coding standards

```
docker run --interactive --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install
docker run --interactive --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer coding-standards-check
```

Apply coding standard changes

```
docker run --interactive --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install
docker run --interactive --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer coding-standards-apply
```

Code analysis
-------------

[](#code-analysis)

phpstan is used to perform static analysis of the code. Run the following script:

```
./scripts/code-analysis
```

### Markdown files

[](#markdown-files)

```
docker run --interactive --rm --volume "$PWD:/md" itkdev/markdownlint markdownlint '**/*.md' --fix
docker run --interactive --rm --volume "$PWD:/md" itkdev/markdownlint markdownlint '**/*.md'
```

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance56

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~31 days

Total

17

Last Release

366d ago

Major Versions

0.2.2 → 1.0.02025-02-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33924554?v=4)[ITK Development](/maintainers/itk-dev)[@itk-dev](https://github.com/itk-dev)

![](https://avatars.githubusercontent.com/u/827308?v=4)[Jørn Skifter Andersen](/maintainers/skifter)[@skifter](https://github.com/skifter)

---

Top Contributors

[![cableman](https://avatars.githubusercontent.com/u/111397?v=4)](https://github.com/cableman "cableman (49 commits)")[![jekuaitk](https://avatars.githubusercontent.com/u/78410897?v=4)](https://github.com/jekuaitk "jekuaitk (49 commits)")[![martinyde](https://avatars.githubusercontent.com/u/545272?v=4)](https://github.com/martinyde "martinyde (10 commits)")[![sinejespersen](https://avatars.githubusercontent.com/u/15377965?v=4)](https://github.com/sinejespersen "sinejespersen (7 commits)")[![rimi-itk](https://avatars.githubusercontent.com/u/11267554?v=4)](https://github.com/rimi-itk "rimi-itk (1 commits)")[![stankut](https://avatars.githubusercontent.com/u/1537807?v=4)](https://github.com/stankut "stankut (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/os2web-os2web-audit/health.svg)

```
[![Health](https://phpackages.com/badges/os2web-os2web-audit/health.svg)](https://phpackages.com/packages/os2web-os2web-audit)
```

###  Alternatives

[farmos/farmos

A web-based farm record keeping application.

1.3k7.1k1](/packages/farmos-farmos)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M278](/packages/open-telemetry-api)[thunder/thunder-distribution

The thunder distribution

51661.9k3](/packages/thunder-thunder-distribution)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

43785.5k4](/packages/lullabot-drainpipe)[acquia/cohesion

Site Studio

271.7M10](/packages/acquia-cohesion)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

40252.8k34](/packages/ec-europa-toolkit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
