Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Release: Change Requests 2.1.9 Minor update available for module change_requests (2.1.9). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Log Middleware

2 sites Security covered Drupal 10–11 LOG ecosystem
View on drupal.org

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.

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 5
Maintenance
Dormant

Release Timeline

Releases

Version Type Core 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