habari

spread the news

ha·bar·i - noun
Definition - Swahili greetings: What's the news?


Schedules and Logs

Work continues on Habari, as we add new features. Two important new additions are a scheduling system and logging of events.

Matt Read (BigJibby) contributed a scheduling system. Named after the venerable cron system of UNIX, this new class allows Habari to schedule recurring events to occur at defined intervals. This is great for regular maintenance, and provides an important first step toward support for "future publishing" -- that is, saving a post that is scheduled to be viewable only at some point in the future. Scheduled tasks might be used to automatically purge deleted items older than a certain value; to automatically purge spam comments; or to delete stale log entries.

Another important new feature of Habari is an event log. An event log is an invaluable troubleshooting tool, and also provides a nice way to audit who has done what on the site. The current implementation is bare-bones, but it will soon be expanded to provide robust logging.

To record a log entry, you (currently) use the log() method in the Utils class, like this:Utils::log( 'This is a log item', 'info', 'default', 'habari' );The log() method accepts the following parameters:

  • message: the short message to record
  • severity: one of debug, info, notice, warning, err, crit, alert, emerg
  • type: see below
  • module: the module which defines the specified type. See below for more
  • data: an optional field for larger datasets (say, a full backtrace or var_export() )

Each log entry has a type, or classification for the kind of message that it is. Habari defines a number of basic types ("default", "authentication", etc) for basic log entries that Habari will record. Plugins can register additional types, so that a plugin can record information meaningful to it. Event types are further classified against their module, in order to disambiguate two types of the same name. For example, a plugin to support LDAP logins might register its own "authentication" type. By using the plugin name as the value of "module", the Habari logging mechanism can keep track of log entries for both the default "authentication" type and the LDAP login "authentication" type.

Work is underway to build the display necessary to view, sort, and search log entries.


1 Responses to Schedules and Logs

  1. 33 yehor May 30, 2007 9:54am

    really nice news, i like the project and i'm really interested in the next release. and what do you think about implementing microformats in habari?

Leave a Reply