[development] New Drupal Logging to text file Module

Ian Bezanson irb at ianbezanson.ca
Mon Feb 11 13:03:05 UTC 2008


And again...

The company I work for bases all of our projects on the Drupal
infratructure.  The watchdog application simply doesn't work for us, so
I'd created a module to log messages to file in the format:

00:00:58 [module::function_name][LOG_LEVEL]: Checking to see if user
0c2f977cc24e4e41d8cd6d9a4099ab0b is anonymous.

We've decided that this is likely a worthwhile project to release to the
community, so I am currently working on a release.  Right now, I have a
group of Log Levels (FATAL, ERROR, WARN, INFO, DEBUG, TRACE), one log
type (DRUPAL_BASE) and the ability to add/configure more.

The site admin can configure whether or not to turn on logging, a
minimum log level to write out, where the log files should live, etc.

I will send another message once the initial release is made, but wanted
to gauge what people thought about this module.  It's more of a
developer's module, as it requires developers to add a hook, such as:
  drupal_log_to_file("MODULE_NAME::FUNCTION_NAME", "LOG_TYPE",
LOG_LEVEL, "MESSAGE")

into their code, in order for the system to log anything.

Let me know anyone's thoughts :)

-- 
Ian Bezanson
irb at ianbezanson.ca


More information about the development mailing list