Zend Framework 101: Zend_Log
Recording Events
As we briefly saw in the previous section, you can record a message to the log using the log() method. The first argument is the message you want to log while the second argument is the priority level of the message.
By default, the priorities are as follows:
Zend_Log::EMERG: Emergency: system is unusableZend_Log::ALERT: Alert: action must be taken immediatelyZend_Log::CRIT: Critical: critical conditionsZend_Log::ERR: Error: error conditionsZend_Log::WARN: Warning: warning conditionsZend_Log::NOTICE: Notice: normal but significant conditionZend_Log::INFO: Informational: informational messagesZend_Log::DEBUG: Debug: debug messages
You can pass any of these constants as the second argument to log(), or you can use one of the helper methods provided by Zend_Log. Previously we used $logger->log('message', Zend_Logger::INFO), but Zend_Log also allows us to use the shorthand method of $logger->info('message').
Messages for other priorities can also be recorded in this manner. For instance, $logger->warn('Some Warning') instead of $logger->log('Some Warning', Zend_Log::WARN).
addPriority() method.




