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


PHP Logger::alert方法代码示例

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


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

示例1: alert

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

示例2: sendAttentionMail

 public function sendAttentionMail($inspectionMessage)
 {
     $this->getMailer()->setBody($inspectionMessage . " | " . serialize($this->executedWithError));
     $sentResult = $this->getMailer()->send();
     $this->logger->alert("Mail from " . $this->getMailer()->getFrom() . " TO: " . serialize($this->getMailer()->getAllRecipientAddresses()) . " with subject " . $this->getMailer()->getSubject() . " contain " . serialize($this->getMailer()->getBody()) . " with result  " . serialize($sentResult) . " was sent.");
     return null;
 }
开发者ID:jamset,项目名称:tasks-inspector,代码行数:7,代码来源:Inspector.php

示例3: refund

 public function refund(PayableInterface $payable, $reference)
 {
     try {
         $amount = $this->getAmountBySmallestCurrencyUnit($payable);
         return $this->_charge->refund($reference, $amount);
     } catch (\Exception $e) {
         $this->_logger->alert($e);
         throw $e;
     }
 }
开发者ID:mothership-ec,项目名称:cog-mothership-stripe,代码行数:10,代码来源:Gateway.php

示例4: 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

示例5: alert

 /**
  * Adds a log record at the ALERT 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 alert($message, $context = array())
 {
     return \Monolog\Logger::alert($message, $context);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例6: testError

 public function testError(FailEvent $e)
 {
     $this->logger->alert($e->getFail()->getMessage());
     $this->logger->info("# ERROR #");
 }
开发者ID:corcre,项目名称:elabftw,代码行数:5,代码来源:Logger.php

示例7: alert

 /**
  * Adds a log record at the ALERT level.
  *
  * @param string $message The log message
  * @param array $context The log context
  * @return Boolean Whether the record has been processed
  */
 public function alert($message, array $context = array())
 {
     return $this->_logger->alert($message, $context);
 }
开发者ID:360i,项目名称:sonno,代码行数:11,代码来源:MonologAdapter.php

示例8: testError

 public function testError(\Codeception\Event\Fail $e)
 {
     $this->logger->alert($e->getFail()->getMessage());
     $this->logger->info("# ERROR #");
 }
开发者ID:lenninsanchez,项目名称:donadores,代码行数:5,代码来源:Logger.php

示例9: alert

 /**
  * Action must be taken immediately.
  *
  * Example: Entire website down, database unavailable, etc. This should
  * trigger the SMS alerts and wake you up.
  *
  * @param string $message
  * @param array $params
  * @param array $context
  * @return null
  */
 public function alert($message, array $params = array(), array $context = array())
 {
     $logMessage = $this->createMessage($message, $params);
     $this->logger->alert($logMessage, $context);
 }
开发者ID:rlacerda83,项目名称:laravel-dynamic-logger,代码行数:16,代码来源:DynamicLogger.php

示例10: alert

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

示例11: logFinishShutDown

 public function logFinishShutDown()
 {
     $this->logger->alert("Finish shutDown in " . $this->shutDownType . "| PID: " . posix_getpid());
     return null;
 }
开发者ID:jamset,项目名称:gearman-conveyor,代码行数:5,代码来源:BaseCommonWorker.php

示例12: catch

    try {
        $ttl = $arguments['ttl'] && is_numeric($arguments['ttl']) ? (int) $arguments['ttl'] : 0;
        $deletedJobs = $queue->cleanupTable($ttl);
        cli\line("%g{$deletedJobs} jobs tidied up from '{$config['table_name']}'%n");
    } catch (Exception $e) {
        cli\err("%rUnable to cleanup table: " . $e->getMessage() . "%n");
        exit(1);
    }
    exit(0);
}
//------------------------------------
// Validate the table (and connection)
try {
    $valid = $queue->isTableValid();
    if (is_array($valid)) {
        $logger->alert("Errors were found when validating the table is setup correctly", $valid);
        exit(1);
    }
} 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);
开发者ID:nsmithuk,项目名称:dynamo-queue-php,代码行数:31,代码来源:worker.php

示例13: testProcessorsNotCalledWhenNotHandled

 /**
  * @covers Monolog\Logger::addRecord
  */
 public function testProcessorsNotCalledWhenNotHandled()
 {
     $logger = new Logger(__METHOD__);
     $handler = $this->getMock('Monolog\\Handler\\HandlerInterface');
     $handler->expects($this->once())->method('isHandling')->will($this->returnValue(false));
     $logger->pushHandler($handler);
     $that = $this;
     $logger->pushProcessor(function ($record) use($that) {
         $that->fail('The processor should not be called');
     });
     $logger->alert('test');
 }
开发者ID:beyonddoor,项目名称:monolog,代码行数:15,代码来源:LoggerTest.php

示例14: alert

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

示例15: alert

 public function alert($msg)
 {
     $this->logger->alert($msg);
 }
开发者ID:db80,项目名称:ovo-container,代码行数:4,代码来源:MonologAdapter.php


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