log4drupal - an updated logging api for drupal 6
drupal 6 included an upgrade to the built in logging functionality (watchdog). drupal 6 exposes a new hook, hook_watchdog
which modules may implement to log Drupal events to custom destinations. it also includes two implementations, the dblog
module which logs to the watchdog table, and the syslog
module which logs to syslog.
with these upgrades, log4drupal is less critical addition to a drupal install, and i hesitated before providing a drupal 6 upgrade. however, eventually i decided that log4drupal is still a useful addition to a drupal development environment as log4drupal provides the following features still not provided by the upgraded drupal 6 watchdog implementation :
- a java-style stacktrace including file and line numbers, showing the path of execution
- automatic recursive printing of all variables passed to the log methods
- ability to change the logging level on the fly
in addition, the drupal 6 version of log4drupal includes the following upgrades from the drupal 5 version
- all messages sent to the watchdog method are also output via log4drupal
- severity levels have been expanded to confirm to RFC 3164
- log module now loaded during the drupal bootstrap phase so that messages may be added within
hook_boot
implementations.
you may download the drupal 6 version here. see below for general information on what this module is about and how it works.