本文整理汇总了PHP中eZLog::setMaxLogSize方法的典型用法代码示例。如果您正苦于以下问题:PHP eZLog::setMaxLogSize方法的具体用法?PHP eZLog::setMaxLogSize怎么用?PHP eZLog::setMaxLogSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZLog
的用法示例。
在下文中一共展示了eZLog::setMaxLogSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param SQLIImportHandlerOptions $options
*/
public function __construct( SQLIImportHandlerOptions $options = null )
{
parent::__construct( $options );
$ftpFolder = 'oscar1';
$modeUAT = false;
$this->startDate = microtime( true );
if ( $this->importINI->hasVariable( 'XMLImportSettings', 'ModeUAT' )
&& $this->importINI->variable( 'XMLImportSettings', 'ModeUAT' ) == 'enabled' )
{
$modeUAT = true;
}
if ( is_object($this->options) )
{
if ( $this->options->hasAttribute( 'reportLevel' ) && is_numeric($reportLevel = $this->options->attribute( 'reportLevel' )) )
XMLImportMonitor::setReportLevel( $reportLevel );
if ( $this->options->hasAttribute( 'ftpFolder' ) && in_array($this->options->attribute( 'ftpFolder' ),array('oscar1','oscar2') ) )
$ftpFolder = $this->options->attribute( 'ftpFolder' );
}
$this->rootImportFolder = $ftpFolder;
// Initialize sqliImportItem Statistics and logs
XMLImportDB::init( $this->importINI );
XMLImportMapping::init( $this->importINI );
eZLog::setMaxLogSize( 2000000 );
eZLog::setLogrotateFiles( 20 );
XMLImportMonitor::setOrigin($ftpFolder);
XMLImportMonitor::setSQLiImportItem( $this->getCurrentSQLiImportItem() );
XMLImportMonitor::pushStatistic( 'start_date', time() );
$this->fileHandler = XMLImportFileHandler::instance($this->importINI, $ftpFolder, $modeUAT);
XMLImportDataHandler::setIni ( $this->importINI );
XMLImportDataHandler::setFileHandler ( $this->fileHandler );
}
示例2: handleError
/**
* Runs the defined error module
* Sets the state of the module object to \c failed and sets the error code.
*
* @param mixed $errorCode
* @param mixed $errorType
* @param array $parameters
* @param mixed $userParameters
*
* @see setErrorModule(), errorModule()
*/
function handleError( $errorCode, $errorType = false, $parameters = array(), $userParameters = false )
{
if ( !$errorType )
{
eZDebug::writeWarning( "No error type specified for error code $errorCode, assuming kernel.\nA specific error type should be supplied, please check your code.", __METHOD__ );
$errorType = 'kernel';
}
$errorModule = $this->errorModule();
$module = eZModule::findModule( $errorModule['module'], $this );
if ( $module === null )
{
return false;
}
if ( $errorCode == eZError::KERNEL_ACCESS_DENIED )
{
eZLog::setMaxLogSize( 10 * 1024 * 1024 );
eZLog::write("Request : " . var_export($_REQUEST, true), 'access_denied.log');
eZLog::write('Server : ' . var_export($_SERVER, true), 'access_denied.log');
eZLog::write("Env : " . var_export($_ENV, true), 'access_denied.log');
}
elseif ( $errorCode == eZError::KERNEL_MODULE_NOT_FOUND )
{
eZLog::setMaxLogSize( 10 * 1024 * 1024 );
eZLog::write("Request : " . var_export($_REQUEST, true), 'module_not_found.log');
eZLog::write('Server : ' . var_export($_SERVER, true), 'module_not_found.log');
eZLog::write("Env : " . var_export($_ENV, true), 'module_not_found.log');
}
$result = $module->run( $errorModule['view'], array( $errorType, $errorCode, $parameters, $userParameters ) );
// The error module may want to redirect to another URL, see error.ini
if ( $this->exitStatus() != eZModule::STATUS_REDIRECT and
$this->exitStatus() != eZModule::STATUS_RERUN )
{
$this->setExitStatus( eZModule::STATUS_FAILED );
$this->setErrorCode( $errorCode );
}
return $result;
}