當前位置: 首頁>>代碼示例>>PHP>>正文


PHP RotatingFileHandler::pushProcessor方法代碼示例

本文整理匯總了PHP中Monolog\Handler\RotatingFileHandler::pushProcessor方法的典型用法代碼示例。如果您正苦於以下問題:PHP RotatingFileHandler::pushProcessor方法的具體用法?PHP RotatingFileHandler::pushProcessor怎麽用?PHP RotatingFileHandler::pushProcessor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Monolog\Handler\RotatingFileHandler的用法示例。


在下文中一共展示了RotatingFileHandler::pushProcessor方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: configureFileLogs

 public static function configureFileLogs(Monolog $monolog, $filePath)
 {
     $files = new RotatingFileHandler($filePath, 365, Logger::DEBUG, true, 0666);
     $files->setFormatter(new HtmlFormatter());
     $files->pushProcessor(new WebProcessor());
     $files->pushProcessor(new IntrospectionProcessor(Logger::DEBUG));
     $monolog->pushHandler($files);
 }
開發者ID:swayok,項目名稱:laravel-extended-errors,代碼行數:8,代碼來源:ConfigureLogging.php

示例2: Logger

use Monolog\Processor\MemoryUsageProcessor;
use Symfony\Component\ClassLoader\Psr4ClassLoader;
// this makes our life easier when dealing with paths. Everything is relative to the application root now.
chdir(dirname(__DIR__));
// initialize autoloading
require __DIR__ . '/../vendor/autoload.php';
$loader = new Psr4ClassLoader();
$loader->addPrefix('Pids\\', 'src' . DIRECTORY_SEPARATOR . 'Pids');
$loader->register();
// load config
$aConfig = (include_once 'config' . DIRECTORY_SEPARATOR . 'config.php');
// create logger
$oLogger = new Logger('pids');
if ($aConfig['logging']['enable']) {
    $oHandler = new RotatingFileHandler('log' . DIRECTORY_SEPARATOR . 'access.log', 7, $aConfig['logging']['level']);
    $oHandler->pushProcessor(new WebProcessor());
    if ($aConfig['logging']['level'] == Logger::DEBUG) {
        $oHandler->pushProcessor(new MemoryUsageProcessor());
    }
    $oLogger->pushHandler($oHandler);
}
// create controller and process request
$oController = new Controller($aConfig, $oLogger);
try {
    $sImage = $oController->process($_REQUEST["filter"], $_REQUEST["options"], $_REQUEST["file"]);
    header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
    header("Cache-Control: max-age=3600, must-revalidate");
    header("Content-Type: image/jpeg");
    readfile($sImage);
    exit;
} catch (Exception $e) {
開發者ID:NormanMalessa,項目名稱:pids,代碼行數:31,代碼來源:index.php


注:本文中的Monolog\Handler\RotatingFileHandler::pushProcessor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。