5

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.

2 Answers 2

4

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
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
    Commented Jan 20, 2016 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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