本文整理匯總了PHP中Monolog\Logger::err方法的典型用法代碼示例。如果您正苦於以下問題:PHP Logger::err方法的具體用法?PHP Logger::err怎麽用?PHP Logger::err使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Monolog\Logger
的用法示例。
在下文中一共展示了Logger::err方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct(\Niysu\Server $server, \Monolog\Logger $log = null)
{
// creating the loader
$this->filesystemLoader = new \Twig_Loader_Filesystem([]);
$loader = new \Twig_Loader_Chain([$this->filesystemLoader, new \Twig_Loader_String()]);
// creating twig
$this->twig = new \Twig_Environment($loader, []);
// the "path" function
// TODO: log when something wrong happens
$pathFunction = function ($name, $params = []) use($server, $log) {
$route = $server->getRouteByName($name);
if (!$route) {
$log->err('Unable to find route named ' . $name . ' in Twig template');
return '';
}
if (!isset($params) || !is_array($params)) {
$params = [];
}
try {
return $route->getURL($params);
} catch (\Exception $e) {
$log->err('Unable to build route URL for ' . $name . ' in Twig template', ['params' => $params]);
return '';
}
};
// registering functions
$this->twig->addFunction(new \Twig_SimpleFunction('path', $pathFunction));
$this->twig->addFunction(new \Twig_SimpleFunction('url', $pathFunction));
}
示例2: send
/**
* @param PlayzoneMessage $messageObject
* @param WebsocketUser $wsUser
*/
private function send(PlayzoneMessage $messageObject, WebsocketUser $wsUser)
{
try {
$this->container->get("ws.handler.client.message")->prepareMessageForUser($messageObject, $wsUser);
$message = $this->container->get('jms_serializer')->serialize($messageObject, 'json');
$this->logger->info("Server: " . $message);
$wsUser->getConnection()->send($message);
} catch (\Exception $exception) {
$this->logger->err("Error on send: " . $exception->getMessage() . ' ' . $exception->getFile() . ' ' . $exception->getLine());
$wsUser->getConnection()->send($exception->getMessage() . ' ' . $exception->getFile() . ' ' . $exception->getLine());
}
}
示例3: getAvailability
private function getAvailability($ids)
{
$minRates = array();
try {
if ($ids) {
$minRates = $this->reservitUtils->getAvailability($this->searchData->datePax, $ids);
}
} catch (\Exception $e) {
$this->errors[] = 'search.results.error.reservit';
$this->logger->err($e->getMessage());
}
return $minRates;
}
示例4: err
/**
* Adds a log record at the ERROR level.
*
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
*/
public function err($message, array $context = array())
{
return $this->_logger->err($message, $context);
}
示例5: while
continue;
}
while ($row = mysql_fetch_array($table)) {
$to_email = $row["to_email"];
$to_mobile = $row["to_mobile"];
$to_jid = $row["to_jid"];
$content = $row["remindcontent"];
//發送郵件
if ($to_email != null && !empty($to_email)) {
$fromname = $row["from_name"];
try {
$title = mb_substr($content, 0, 20, 'utf-8');
$mailtext = \Swift_Message::newInstance()->setSubject($title)->setFrom(array($mailer_user => $fromname))->setTo($to_email)->setContentType('text/html')->setBody($content . "【Wefafa企業協作平台】");
$mailer->send($mailtext);
} catch (\Exception $e) {
$logger->err($e);
}
}
//發送手機短信
if ($to_mobile != null && !empty($to_mobile)) {
if ($content != null || !empty($content)) {
call_user_func("sendMobile", $SMS_ACT, $SMS_PWD, $SMS_URL, $to_mobile, $content . "【發發時代】");
}
}
//發送wefafa消息
if ($to_jid != null && !empty($to_jid)) {
$from_jid = $row["from_jid"];
if ($from_jid != null || !empty($from_jid)) {
call_user_func("sendMsg", $SERVER_URL, $from_jid, $to_jid, "remind_msg", $content, "", "", "");
}
}
示例6: err
/**
* Adds a log record at the ERROR level.
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
* @static
*/
public static function err($message, $context = array())
{
return \Monolog\Logger::err($message, $context);
}
示例7: err
/**
* @param string $message
* @param array $context
* @return bool
*/
public function err($message, array $context = array())
{
return parent::err($message, $context);
}
示例8: error
public function error($msg)
{
$this->logger->err($msg);
}
示例9: error
/**
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
* @param string $message
* @param array $context
*
* @return void
*/
public function error($message, array $context = array())
{
$this->monolog->err($message, $context);
}