本文整理汇总了PHP中LoggerAppender::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerAppender::getName方法的具体用法?PHP LoggerAppender::getName怎么用?PHP LoggerAppender::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerAppender
的用法示例。
在下文中一共展示了LoggerAppender::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Adds an appender to the pool.
* The appender must be named for this operation.
* @param LoggerAppender $appender
*/
public static function add(LoggerAppender $appender)
{
$name = $appender->getName();
if (empty($name)) {
trigger_error('log4php: Cannot add unnamed appender to pool.', E_USER_WARNING);
return;
}
if (isset(self::$appenders[$name])) {
trigger_error("log4php: Appender [{$name}] already exists in pool. Overwriting existing appender.", E_USER_WARNING);
}
self::$appenders[$name] = $appender;
}
示例2: isAttached
/**
* Checks whether an appender is attached to this logger instance.
*
* @param LoggerAppender $appender
* @return boolean
*/
public function isAttached(LoggerAppender $appender)
{
return isset($this->appenders[$appender->getName()]);
}
示例3: isAttached
/**
* Is the appender passed as parameter attached to this category?
*
* @param LoggerAppender $appender
*/
public function isAttached($appender)
{
return isset($this->aai[$appender->getName()]);
}
示例4: isAttached
/**
* Is the appender passed as parameter attached to this category?
*
* @param LoggerAppender $appender
*/
function isAttached($appender)
{
return in_array($appender->getName(), array_keys($this->aai));
}
示例5: createAppenderFilter
/**
* Parses filter config, creates the filter and adds it to the appender's
* filter chain.
* @param LoggerAppender $appender
* @param array $config Filter configuration.
*/
private function createAppenderFilter(LoggerAppender $appender, $config)
{
$name = $appender->getName();
$class = $config['class'];
if (!class_exists($class)) {
$this->warn("Nonexistant filter class [{$class}] specified on appender [{$name}]. Skipping filter definition.");
return;
}
$filter = new $class();
if (!$filter instanceof LoggerFilter) {
$this->warn("Invalid filter class [{$class}] sepcified on appender [{$name}]. Skipping filter definition.");
return;
}
if (isset($config['params'])) {
$this->setOptions($filter, $config['params']);
}
$filter->activateOptions();
$appender->addFilter($filter);
}