Enabling 'syslog' on Drupal websites

source : http://drupal.org/documentation/modules/syslog

Syslog is an operating system administration logging tool, where messages are routed by facility and severity. It is more suitable for medium to large sites, and would not be suitable for shared hosting environments. In the file /etc/syslog.conf you define where messages go for any combination of facility and severity.

Here is a three-step guide to switching from Drupal's default database logging to Syslog, modified and expanded from http://mattdanger.net/2011/02/setup-syslog-on-drupal-6-x-and-7-x/. It is for Linux systems only.

1) Install & configure the Syslog module

Go to the Modules page, /admin/build/modules, and install the Syslog module. Then go to the Syslog settings page, /admin/settings/logging/syslog, and select which Syslog level to attach to the log messages. Choose one that is not in use by Syslog

2) Configure Syslog to Log to a Separate File

Edit /etc/syslog.conf and add:

local0.* /var/log/drupal.log
(if local0 is the level that you configured Syslog to use in Step 1)

Then, restart Syslog:

service syslog restart

Note that this is optional. If you do not do this, your messages will most likely be in /var/log/messages.

3) Disable the Database Logging (formerly, Watchdog) Module

Check that you are seeing messages in the syslog by using

tail /var/log/drupal.log

You can also browse the file by using less.

If it is working, you may now go to the modules page and disable Dblog.

For more information on syslog facilities, severity levels, and how to setup a syslog.conf file, see UNIX/Linux syslog.conf and PHP's syslog.




Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.
Bg