Drupal syslogs to a separate file on Ubuntu
Submitted by itefix on Wed, 11/04/2018 - 16:45
- Activate the syslog module in Drupal and configure it according to your needs. The key element in our recipe is the Syslog identity which is drupal by default
- Create the file nn-drupal.conf in the /etc/rsyslog.d directory with the content below. The number nn in the file name should be lower than 50 which is used for default settings (50-default.conf).
# drupal logging if $programname == 'drupal' then /var/log/drupal.log if $programname == 'drupal' then stop
The first line sends log messages to /var/log/drupal.log. The second one instructs rsyslog not to log the same message to the default syslog file. The comparison value drupal is simply the syslog identity value we set up in the previous step.
- Configure logrotation by creating the file /etc/logrotate.d/drupal with the following content:
/var/log/drupal.log { weekly rotate 4 compress delaycompress missingok create 640 syslog adm }
- Restart the rsyslog service:
service rsyslog restart
Featured product
Free Software Highlights
Release Announcements
- 2024-11-25 Copssh client 8.0.0
- 2024-11-17 OpenSSL tool 2.0.1
- 2024-11-17 Wrbldnsd 5.0.2