- Configurable logging levels
- A multitude of handlers
- Different behaviors per channel via "logging profiles"
- All the power and flexibility of Monolog
The Monolog module also has full watchdog integration, so it works with core and contributed modules out of the box.
Follow the standard module installation guide to install the Monolog module. This module depends on the Composer Manager module, so follow the instructions on its project page to install the required third-party libraries.
It is important to be familiar with the core concepts of Monolog before attempting to use this module.
The quickest way to get started is to enable both the Monolog and Monolog Logging modules so that all messages added via the watchdog system are routed through the Monolog library. After enabling the modules, visit
admin/config/development/monolog and select which logging profile is associated with the "Watchdog" channel. Optionally edit the logging profile to configure which handlers will process the records.
The handlers below are made available by this module:
- Stream Handler (Most common use case is logging to files)
- Rotating File Handler
- Syslog Handler
- Native Mail Handler
- ChromePHP Handler
- FirePHP Handler
- Socket Handler
- HipChat Handler
- GELF Handler
- Null handler
In the Drupal 8 version, monolog is configurable through container parameters.
You can specify handlers per channel in your site specific
services.yml file. eg:
parameters: monolog.channel_handlers: # Log to the syslog by default. default: ['syslog'] # Send the php channel to web server's error log and the browser console: php: ['error_log', 'browser_console'] # Ignore log entries of "content" channel. content: ['null']
or configuring processors:
parameters: # Show memory usage on each log entry: monolog.processors: ['message_placeholder', 'current_user', 'request_uri', 'ip', 'referer', 'memory_usage']
Changing levels and bubling for handlers is done by changing the service definition:
services: monolog.handler.browser_console: class: Monolog\Handler\BrowserConsoleHandler # Set alert as the minimum level (ignores emergency) and disable bubbling for this Handler arguments: ['1', false]
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Developer, Third-party Integration, Utility
- Reported installs: 725 sites currently report using this module. View usage statistics.
- Downloads: 18,598
- Automated tests: Enabled
- Last modified: February 17, 2016
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.