本文整理汇总了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);
}
示例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) {