当前位置: 首页>>代码示例>>PHP>>正文


PHP Logger::emergency方法代码示例

本文整理汇总了PHP中Monolog\Logger::emergency方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::emergency方法的具体用法?PHP Logger::emergency怎么用?PHP Logger::emergency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Monolog\Logger的用法示例。


在下文中一共展示了Logger::emergency方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: emergency

 public function emergency($message, array $args = [], array $context = [])
 {
     if (count($args)) {
         $message = vsprintf($message, $args);
     }
     return parent::emergency($message, $context);
 }
开发者ID:acgrid,项目名称:adbot,代码行数:7,代码来源:Logger.php

示例2: checkIsConfigured

 /**
  * Проверяет, что сервис был корректно сконфигурирован
  *
  * @throws ConfigurationErrorException
  */
 private function checkIsConfigured()
 {
     if (!$this->isConfigured()) {
         $message = sprintf(self::ERR__NOT_CONFIGURED, get_class($this));
         $this->logger->emergency($message);
         throw new ConfigurationErrorException($message);
     }
 }
开发者ID:itmh,项目名称:service-tools,代码行数:13,代码来源:Service.php

示例3: testPushErrors

 /**
  *
  */
 public function testPushErrors()
 {
     $redis = \Mockery::mock('Predis\\Client')->shouldReceive('publish')->times(8)->with('log', \Mockery::any())->mock();
     $monolog = new Logger('test');
     $monolog->pushHandler(new PublishHandler(new RedisPublisher($redis)));
     $monolog->debug('the message was: {message}', ['DEBUG!']);
     $monolog->info('the message was: {message}', ['INFO!']);
     $monolog->notice('the message was: {message}', ['NOTICE!']);
     $monolog->warning('the message was: {message}', ['WARNING!']);
     $monolog->error('the message was: {message}', ['ERROR!']);
     $monolog->critical('the message was: {message}', ['CRITICAL!']);
     $monolog->alert('the message was: {message}', ['ALERT!']);
     $monolog->emergency('the message was: {message}', ['EMERGENCY!']);
 }
开发者ID:zae,项目名称:monolog-publish,代码行数:17,代码来源:RedisTest.php

示例4: write

 /**
  * {@inheritdoc}
  */
 public function write($exception, $logType)
 {
     foreach ($this->rules as $rule => $condition) {
         switch ($rule) {
             case '!instanceof':
                 if ($exception instanceof $condition) {
                     return;
                 }
                 break;
             case 'instanceof':
                 if (!$exception instanceof $condition) {
                     return;
                 }
                 break;
         }
     }
     $context = is_callable($this->context) ? call_user_func($this->context, $exception) : null;
     if ($context === null) {
         $context = array('file' => $exception->getFile(), 'line' => $exception->getLine(), 'trace' => $exception->getTrace(), 'logType' => $logType);
     }
     $this->logger->emergency($exception->getMessage(), $context);
 }
开发者ID:bitrix-expert,项目名称:monolog-adapter,代码行数:25,代码来源:ExceptionHandlerLog.php

示例5: emergency

 /**
  * Adds a log record at the EMERGENCY level.
  *
  * @param string $message The log message
  * @param array $context The log context
  * @return Boolean Whether the record has been processed
  * @static 
  */
 public static function emergency($message, $context = array())
 {
     return \Monolog\Logger::emergency($message, $context);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例6: emergency

 /**
  * System is unusable.
  *
  * @param string $message
  * @param array $context
  * @return null
  */
 public function emergency($message, array $context = array())
 {
     $this->logger->emergency($message, $context);
 }
开发者ID:tylercd100,项目名称:laravel-notify,代码行数:11,代码来源:Base.php

示例7: emergency

 /**
  * System is unusable.
  *
  * @param string $message
  * @param array $params
  * @param array $context
  * @return null
  */
 public function emergency($message, array $params = array(), array $context = array())
 {
     $logMessage = $this->createMessage($message, $params);
     $this->logger->emergency($logMessage, $context);
 }
开发者ID:rlacerda83,项目名称:laravel-dynamic-logger,代码行数:13,代码来源:DynamicLogger.php

示例8: emergency

 /**
  * @inheritdoc
  * @return boolean Whether the record has been processed.
  */
 public function emergency($message, array $context = [])
 {
     return $this->_monolog->emergency($message, $context);
 }
开发者ID:uniconstructor,项目名称:yii2-monolog,代码行数:8,代码来源:Logger.php

示例9: catch

} catch (Exception $e) {
    $logger->alert("Unable to connect to DynamoDB (and validate the table)", ['exception' => $e]);
    exit(1);
}
//------------------------------------
// Create the process handler
#TODO - This will become a config option so custom Handlers can be used.
$handler = new \DynamoQueue\Worker\Handler\Autoloader();
//------------------------------------
// Create the (a) Worker
$worker = new \DynamoQueue\Worker\Worker($queue, $handler, $logger);
//---
declare (ticks=1);
pcntl_signal(SIGTERM, array($worker, 'stop'));
pcntl_signal(SIGINT, array($worker, 'stop'));
pcntl_signal(SIGQUIT, array($worker, 'stop'));
//---
try {
    $logger->notice("Worker started");
    $okay = $worker->run();
} catch (Exception $e) {
    $logger->emergency("An unknown exception has caused the queue to terminate", ['exception' => $e]);
    exit(1);
}
//---
$logger->notice("Worker stopped");
if ($okay) {
    exit(0);
} else {
    exit(1);
}
开发者ID:nsmithuk,项目名称:dynamo-queue-php,代码行数:31,代码来源:worker.php

示例10: write

 /**
  * {@inheritdoc}
  */
 public function write(\Exception $exception, $logType)
 {
     $this->logger->emergency($exception->getMessage(), array('exception' => $exception->getTrace(), 'logType' => $logType));
 }
开发者ID:lithium-li,项目名称:monolog-adapter,代码行数:7,代码来源:ExceptionHandlerLog.php

示例11: emergency

 /**
  * @param string $message
  * @param array $context
  * @return bool
  */
 public function emergency($message, array $context = array())
 {
     return parent::emergency($message, $context);
 }
开发者ID:akentner,项目名称:incoming-ftp,代码行数:9,代码来源:LoggerProxy.php

示例12: MonologHandler

<?php

include 'basics.php';
use unreal4u\MonologHandler;
use unreal4u\TgLog;
use Monolog\Logger;
#$monologTgLogger = new MonologHandler(new TelegramLog(BOT_TOKEN), A_USER_CHAT_ID, Logger::DEBUG); // Sends from DEBUG+
$monologTgLogger = new MonologHandler(new TgLog(BOT_TOKEN), A_USER_CHAT_ID, Logger::ERROR);
// Sends ERROR+
//Create logger
$logger = new Logger('TelegramLogger');
$logger->pushHandler($monologTgLogger);
//Now you can use the logger, and further attach additional information
$logger->debug('Nobody gives a dime for debug messages', ['moreInfo' => 'Within here']);
$logger->info('A user has logged in');
$logger->notice('Something unusual has happened!', ['it did indeed']);
$logger->warning('Somebody should attend this', ['some', 'extra' => 'information']);
$logger->error('Something really bad happened');
$logger->critical('A critical message', ['please' => 'Check this out']);
$logger->alert('This is an alert', ['oh no...' => 'This might be urgent']);
$logger->emergency('Run for your lives!', ['this is it' => 'everything has stopped working']);
开发者ID:unreal4u,项目名称:monolog-telegram,代码行数:21,代码来源:monolog-example.php


注:本文中的Monolog\Logger::emergency方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。