本文整理匯總了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) {