Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Log Middleware

Security covered Maintenance fixes only 2 sites

Part of the LOG ecosystem · 10 projects

This module enhances Drupal's logging system by allowing you to add custom middleware. This middleware can modify or even discard log messages before they are processed. Functions as standard Drupal logging if no middleware is configured.

This module provides a customized LoggerChannel implementation with support for middleware. The logger channel and the logger channel factory extend the drupal core equivalents and just add support for middleware. Nothing else is altered in the logger channel implementation.

The module just provides support for middleware and does not provide middleware itself.

Without modules providing middleware the logger functions exactly the same as the drupal core one.

Adding Middleware

Each service tagged with log_middleware will automatically be attached to the logger channel and is applied before processing the log message.

A middleware can alter the log level, message and context. Additionally a middleware can discard a message entirely.

The service tag supports the following arguments:

  • priority: a numeric value indicating the order of which the middleware is run. The higher the number the earlier the middleware is applied. Negative values are allowed.
  • channels: an array with the logger channel names this middleware should be applied to. If empty, the middleware is applied to all channels.

All arguments are optional.

Example middleware implementations can be found in the ./tests/modules/log_test_middleware module.

Drupal 10–11

Ask your assistant about Log Middleware

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Oct 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.0 Stable 10–11 Jan 20, 2025
2.x-dev Dev 10–11 Jan 20, 2025
1.0.1 Stable 10–11 Oct 10, 2024
1.0.0 Stable 10–11 Oct 10, 2024
1.x-dev Dev 10–11 Oct 10, 2024