Drupal 6_ proposal for a watchdog hook for logging and alerts _ the baheyeldin dynasty

Drupal has a module called watchdog that logs all messages to a database table. R studio data recovery software The module is currently mandatory, and hence writing to the table cannot be easily removed without hacking core. Data recovery iphone This can be a problem on sites with heavy traffic where the database is loaded with more logging unecessarily.


In issue #63881 from a while back on making watchdog a hook. Ease use data recovery The initial took a radical approach of making the watchdog module into its own watchdog.inc. Free database software This patch went no where, and Dries asked for a simple setting to enable either watchdog or syslog.

• Implement a new watchdog hook which modules can use to extend or replace the logging functionality of Drupal, and even push that into the realm of alerts, which we did not have in Drupal so far.

Under modules, there is now a new category called “Logging and alerts” that lists all the modules that implement the new watchdog hook. Raid 0 data recovery software The site owner can choose none of the modules (no logging at all), or one or more modules (same message goes to different destinations).

Clicking on it, all the modules that implement the hook are listed, with the site admin having the option to enable one or more of them, or even none of them.

As you can see each severity level can go to a different email address. Mail database So high priority stuff can be sent to a pager or mobile phone, while medium priority stuff can be send to a regular mailbox, and low priority can be sent to yet another mailbox.

Syslog is the UNIX way of logging over a network. Hdata recovery master This is defined in RFC 3164. In database Windows supports syslog via third party software (free and commercial). Drupal 7 database query The most simple form is to log messages to the file /var/log/syslog. Data recovery usa However, there is an /etc/syslog.conf that defines where things go. Data recovery business In a large server farm, there would be a separate logging server that all the other servers send the messages too. Database visualization If the organization has a centralized network management system like HP Open View, IBM Tivoli, or even Nagios, messages from the syslog can go to various destination depending on their origin and priority.

The syslog module maps the Drupal WATCHDOG severity levels to RFC 3164 values, and hands over the message to syslog. Data recovery qatar The message is completely themable.

Here is how a syslog message from Drupal looks like. Data recovery no root The fields are separate by a | in case there is a need to parse it downstream in UNIX land.

Apr 2 00:28:08 server1 apache2: Drupal | http://example.com | 1175488087 | content | 1 | 192.168.0.249 | http://example.com/?q=node/add/page | http://example.com/?q=node/add/page | view | page: added Another node.

Well, this hook opens a lot of possibilities. Database keywords One immediate benefit is that it avoids logging to the database on busy sites (e.g. Normalization in database Drupal.org), and offloads message handling to other means (e.g. Database 3nf syslog). Database server The other benefit is opening the possibility of alerts, which was not possible before. Data recovery wd passport Things like alerts to mobile phones, SMS, instant messaging (Jabber for example), SNMP or whatever you can imagine.

One thing I like to add after this patch is accepted is to expand the number of severities from the current three (ERROR, WARNING, NOTICE) to at least five (CRITICAL, ERROR, WARNING, NOTICE, INFO). Relational database management system Critical can then be the only one sent to pagers and the like, and the rest handled only by syslog for example.

banner