Drupal 8 monolog logging
parameters: | |
... | |
monolog.channel_handlers: | |
# Log to a file by default. | |
default: ['file'] | |
# 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'] | |
# Show memory usage on each log entry: | |
monolog.processors: ['message_placeholder', 'current_user', 'request_uri', 'memory_usage', 'web'] | |
services: | |
# Monolog handlers. | |
monolog.handler.file: | |
class: Monolog\Handler\RotatingFileHandler | |
arguments: ['../logs/application.log', '30', '200', false] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Install Drupal 8 monolog module
composer require drupal/monolog
Enable monolog module
Add this snippet (except the first 4 lines) to sites/default/services.yml, you can also customize it to use different monolog processors & handlers as you desire
Uninstall watchdog module as it will no longer work