4

There are several types of log messaging severity levels - emergency, critical, error, alert, info, notice, warning, debug. What does each level mean? Example, emergency and critical sound similar, what's the difference? Also, info and notice sound similar.

3

The levels are mostly arbitrary below alert, and just represent a general priority of "badness".

In theory, a minimum log level could be set up in core, so that you could enable logging on a live site, but only have certain levels logged (say, emergency, critical, error, and alert) and the rest ignored. To my knowledge, this hasn't been implemented (I would love to be shown wrong about this).

The current usage has more to do with filtering on the recent log messages page (admin/reports/dblog).

1
  • The ability to turn off debug messages on any environment would be good.
    – chim
    Jan 20 '16 at 10:32
3

The code is the best manual :)

/**
 * Log message severity -- Emergency: system is unusable.
 */
define('WATCHDOG_EMERGENCY', 0);
/**
 * Log message severity -- Alert: action must be taken immediately.
 */
define('WATCHDOG_ALERT', 1);
/**
 * Log message severity -- Critical conditions.
 */
define('WATCHDOG_CRITICAL', 2);
/**
 * Log message severity -- Error conditions.
 */
define('WATCHDOG_ERROR', 3);
/**
 * Log message severity -- Warning conditions.
 */
define('WATCHDOG_WARNING', 4);
/**
 * Log message severity -- Normal but significant conditions.
 */
define('WATCHDOG_NOTICE', 5);
/**
 * Log message severity -- Informational messages.
 */
define('WATCHDOG_INFO', 6);
/**
 * Log message severity -- Debug-level messages.
 */
define('WATCHDOG_DEBUG', 7);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.