array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'seaslog.critical.php', 1 => 'SeasLog::critical', ), 'up' => array ( 0 => 'class.seaslog.php', 1 => 'SeasLog', ), 'prev' => array ( 0 => 'seaslog.construct.php', 1 => 'SeasLog::__construct', ), 'next' => array ( 0 => 'seaslog.debug.php', 1 => 'SeasLog::debug', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/seaslog/seaslog/critical.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL seaslog >=1.0.0)
SeasLog::critical — Record critical log information
Record critical log information.
Note:
"CRITICAL" - Critical conditions.Need to be repaired immediately, and the program component is unavailable.
message
The log message.
content
The `message` contain placeholders which implementors replace with values from content array. Sush as `message` is `log info from {NAME}` and `content` is `array('NAME' => neeke)`, the log information will `log info from neeke`.
logger
The `logger` cased by the third param would be used right this right now, like a temp logger, when the function SeasLog::setLogger() called in pre content. If `logger` NULL or "", SeasLog will use lastest logger setted by SeasLog::setLogger().
Return TRUE on record log information success, FALSE on failure.
Example #1 SeasLog::critical() example
<?php
var_dump(SeasLog::critical('log message'));
//with content
var_dump(SeasLog::critical('log message from {NAME}',array('NAME' => 'neeke')));
//with tmp logger
var_dump(SeasLog::critical('log message from {NAME}',array('NAME' => 'neeke'),'tmp_logger'));
var_dump(SeasLog::getBuffer());
?>
The above example will output something similar to:
bool(true) bool(true) bool(true) array(2) { ["/var/log/www/default/20180707.log"]=> array(2) { [0]=> string(81) "2018-07-07 11:45:49 | CRITICAL | 73263 | 5b40376d1067c | 1530935149.68 | log message " [1]=> string(92) "2018-07-07 11:45:49 | CRITICAL | 73263 | 5b40376d1067c | 1530935149.68 | log message from neeke " } ["/var/log/www/tmp_logger/20180707.log"]=> array(1) { [0]=> string(92) "2018-07-07 11:45:49 | CRITICAL | 73263 | 5b40376d1067c | 1530935149.68 | log message from neeke " } }