本文整理汇总了PHP中LoggerLog类的典型用法代码示例。如果您正苦于以下问题:PHP LoggerLog类的具体用法?PHP LoggerLog怎么用?PHP LoggerLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LoggerLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: close
public function close()
{
$from = $this->from;
$to = $this->to;
if (!empty($this->body) and $from !== null and $to !== null and $this->layout !== null) {
$subject = $this->subject;
LoggerLog::debug("LoggerAppenderMail::close() sending mail from=[{$from}] to=[{$to}] subject=[{$subject}]");
mail($to, $subject, $this->layout->getHeader() . $this->body . $this->layout->getFooter(), "From: {$from}\r\n");
}
$this->closed = true;
}
开发者ID:rrsc,项目名称:freemed,代码行数:11,代码来源:LoggerAppenderMail.php
示例2: addRenderer
/**
* Add a renderer to a hierarchy passed as parameter.
* Note that hierarchy must implement getRendererMap() and setRenderer() methods.
*
* @param LoggerHierarchy $repository a logger repository.
* @param string $renderedClassName
* @param string $renderingClassName
* @static
*/
public static function addRenderer($repository, $renderedClassName, $renderingClassName)
{
LoggerLog::debug("LoggerRendererMap::addRenderer() Rendering class: [{$renderingClassName}], Rendered class: [{$renderedClassName}].");
$renderer = LoggerObjectRenderer::factory($renderingClassName);
if ($renderer == null) {
LoggerLog::warn("LoggerRendererMap::addRenderer() Could not instantiate renderer [{$renderingClassName}].");
return;
} else {
$repository->setRenderer($renderedClassName, $renderer);
}
}
开发者ID:rrsc,项目名称:freemed,代码行数:20,代码来源:LoggerRendererMap.php
示例3: close
function close()
{
$from = $this->getFrom();
$to = $this->getTo();
if (!empty($this->body) && $from !== null && $to !== null && $this->layout !== null) {
$subject = $this->getSubject();
LoggerLog::debug("LoggerAppenderMail::close() sending mail from=[{$from}] to=[{$to}] subject=[{$subject}]");
@mail($to, $subject, $this->layout->getHeader() . $this->body . $this->layout->getFooter(), "From: {$from}\r\n");
}
$this->closed = true;
}
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:11,代码来源:LoggerAppenderMail.php
示例4: setTarget
/**
* Set console target.
* @param mixed $value a constant or a string
*/
public function setTarget($value)
{
$v = trim($value);
if ($v == self::STDOUT || strtoupper($v) == 'STDOUT') {
$this->target = self::STDOUT;
} elseif ($v == self::STDERR || strtoupper($v) == 'STDERR') {
$target = self::STDERR;
} else {
LoggerLog::debug("Invalid target. Using '" . self::STDOUT . "' by default.");
}
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:15,代码来源:LoggerAppenderConsole.php
示例5: append
function append($event)
{
LoggerLog::debug("LoggerAppenderEcho::append()");
if ($this->layout !== null) {
if ($this->firstAppend) {
echo $this->layout->getHeader();
$this->firstAppend = false;
}
echo $this->layout->format($event);
}
}
开发者ID:ruckfull,项目名称:taobaocrm,代码行数:11,代码来源:LoggerAppenderEcho.php
示例6: append
function append($event)
{
LoggerLog::debug("LoggerAppenderFirePHP::append()");
$message = array("message" => $event->getMessage());
if (function_exists('debug_backtrace')) {
$prevHop = null;
$trace = debug_backtrace();
// make a downsearch to identify the caller
$hop = array_pop($trace);
$step = array();
while ($hop !== null) {
$className = @$hop['class'];
if (!empty($className) and ($className == 'loggercategory' or in_array("LoggerCategory", $this->get_ancestors($className)))) {
$step["file"] = str_replace("\\", "/", str_replace(getcwd(), "", $hop["file"]));
$step["line"] = $hop['line'];
break;
}
$prevHop = $hop;
$hop = array_pop($trace);
}
$step['class'] = isset($prevHop['class']) ? $prevHop['class'] : 'main';
if (isset($prevHop['function']) and $prevHop['function'] !== 'include' and $prevHop['function'] !== 'include_once' and $prevHop['function'] !== 'require' and $prevHop['function'] !== 'require_once') {
$step['function'] = $prevHop['function'];
} else {
$step['function'] = 'main';
}
$message["caller"] = join(":", array($step["file"], $step["class"], $step["function"], $step["line"]));
}
$label = "";
if (isset($message["caller"])) {
$label = " " . $message["caller"];
}
$level =& $event->getLevel();
switch ($level->level) {
case LOG4PHP_LEVEL_INFO_INT:
$code = FirePHP::INFO;
break;
case LOG4PHP_LEVEL_WARN_INT:
$code = FirePHP::WARN;
break;
case LOG4PHP_LEVEL_ERROR_INT:
$code = FirePHP::ERROR;
break;
case LOG4PHP_LEVEL_FATAL_INT:
$code = FirePHP::ERROR;
break;
default:
$code = FirePHP::LOG;
break;
}
$this->firephp->fb($message, $level->levelStr . $label, $code);
}
开发者ID:Bobsel,项目名称:gn-tic,代码行数:52,代码来源:LoggerAppenderFirePHP.php
示例7: append
public function append($event)
{
if ($this->layout !== null) {
LoggerLog::debug("LoggerAppenderPhp::append()");
$level = $event->getLevel();
if ($level->isGreaterOrEqual(LoggerLevel::getLevelError())) {
trigger_error($this->layout->format($event), E_USER_ERROR);
} elseif ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) {
trigger_error($this->layout->format($event), E_USER_WARNING);
} else {
trigger_error($this->layout->format($event), E_USER_NOTICE);
}
}
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:14,代码来源:LoggerAppenderPhp.php
示例8:
/**
* @param array $props array of properties
* @param string $appenderName
* @return LoggerAppender
*/
function &parseAppender($props, $appenderName)
{
$appender =& LoggerAppender::singleton($appenderName);
if ($appender !== null) {
LoggerLog::debug("LoggerPropertyConfigurator::parseAppender() " . "Appender [{$appenderName}] was already parsed.");
return $appender;
}
// Appender was not previously initialized.
$prefix = LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_APPENDER_PREFIX . $appenderName;
$layoutPrefix = $prefix . ".layout";
$appenderClass = @$props[$prefix];
if (!empty($appenderClass)) {
$appender =& LoggerAppender::singleton($appenderName, $appenderClass);
if ($appender === null) {
LoggerLog::warn("LoggerPropertyConfigurator::parseAppender() " . "Could not instantiate appender named [{$appenderName}].");
return null;
}
} else {
LoggerLog::warn("LoggerPropertyConfigurator::parseAppender() " . "Could not instantiate appender named [{$appenderName}] with null className.");
return null;
}
$appender->setName($appenderName);
if ($appender->requiresLayout()) {
LoggerLog::debug("LoggerPropertyConfigurator::parseAppender() " . "Parsing layout section for [{$appenderName}].");
$layoutClass = @$props[$layoutPrefix];
$layoutClass = LoggerOptionConverter::substVars($layoutClass, $props);
if (empty($layoutClass)) {
LoggerLog::warn("LoggerPropertyConfigurator::parseAppender() " . "layout class is empty in '{$layoutPrefix}'. Using Simple layout");
$layout = LoggerLayout::factory('LoggerLayoutSimple');
} else {
$layout = LoggerLayout::factory($layoutClass);
if ($layout === null) {
LoggerLog::warn("LoggerPropertyConfigurator::parseAppender() " . "cannot create layout '{$layoutClass}'. Using Simple layout");
$layout = LoggerLayout::factory('LoggerLayoutSimple');
}
}
LoggerLog::debug("LoggerPropertyConfigurator::parseAppender() " . "Parsing layout options for [{$appenderName}].");
LoggerPropertySetter::setPropertiesByObject($layout, $props, $layoutPrefix . ".");
LoggerLog::debug("LoggerPropertyConfigurator::parseAppender() " . "End Parsing layout options for [{$appenderName}].");
$appender->setLayout($layout);
}
LoggerPropertySetter::setPropertiesByObject($appender, $props, $prefix . ".");
LoggerLog::debug("LoggerPropertyConfigurator::parseAppender() " . "Parsed [{$appenderName}] options.");
return $appender;
}
开发者ID:ruckfull,项目名称:taobaocrm,代码行数:50,代码来源:LoggerPropertyConfigurator.php
示例9: LoggerCategoryPatternConverter
/**
* Constructor
*
* @param string $formattingInfo
* @param integer $precision
*/
function LoggerCategoryPatternConverter($formattingInfo, $precision)
{
LoggerLog::debug("LoggerCategoryPatternConverter::LoggerCategoryPatternConverter() precision='{$precision}'");
$this->LoggerNamedPatternConverter($formattingInfo, $precision);
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:11,代码来源:LoggerPatternConverter.php
示例10: debug
/**
* Report a debug message.
*
* @param string $message log message
* @static
* @since 0.3
*/
public static function debug($message)
{
LoggerLog::log($message, E_USER_NOTICE);
}
开发者ID:rrsc,项目名称:freemed,代码行数:11,代码来源:LoggerLog.php
示例11: append
function append($event)
{
if ($this->canAppend) {
$query = $this->layout->format($event);
LoggerLog::debug("LoggerAppenderDb::append() query='{$query}'");
$this->db->query($query);
}
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:8,代码来源:LoggerAppenderDb.php
示例12: setMaxDepth
/**
* Set maximum depth of this diagnostic context. If the current
* depth is smaller or equal to <var>maxDepth</var>, then no
* action is taken.
*
* <p>This method is a convenient alternative to multiple
* {@link pop()} calls. Moreover, it is often the case that at
* the end of complex call sequences, the depth of the NDC is
* unpredictable. The {@link setMaxDepth()} method circumvents
* this problem.
*
* @param integer $maxDepth
* @see getDepth()
* @static
*/
function setMaxDepth($maxDepth)
{
LoggerLog::debug("LoggerNDC::setMaxDepth() maxDepth='{$maxDepth}'");
$maxDepth = (int) $maxDepth;
if ($maxDepth <= LOGGER_NDC_HT_SIZE) {
if (LoggerNDC::getDepth() > $maxDepth) {
$GLOBALS['log4php.LoggerNDC.ht'] = array_slice($GLOBALS['log4php.LoggerNDC.ht'], $maxDepth);
}
$GLOBALS['log4php.LoggerNDC.maxDepth'] = $maxDepth;
}
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:26,代码来源:LoggerNDC.php
示例13: setter
/**
* @param object $object
* @param string $name
* @param mixed $value
*/
function setter(&$object, $name, $value)
{
if (empty($name)) {
LoggerLog::debug("LoggerDOMConfigurator::setter() 'name' param cannot be empty");
return false;
}
$methodName = 'set' . ucfirst($name);
if (method_exists($object, $methodName)) {
LoggerLog::debug("LoggerDOMConfigurator::setter() Calling " . get_class($object) . "::{$methodName}({$value})");
return call_user_func(array(&$object, $methodName), $value);
} else {
LoggerLog::warn("LoggerDOMConfigurator::setter() " . get_class($object) . "::{$methodName}() does not exists");
return false;
}
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:20,代码来源:LoggerDOMConfigurator.php
示例14: finalizeConverter
function finalizeConverter($c)
{
LoggerLog::debug("LoggerPatternParser::finalizeConverter() with char '{$c}'");
$pc = null;
switch ($c) {
case 'c':
$pc = new LoggerCategoryPatternConverter($this->formattingInfo, $this->extractPrecisionOption());
LoggerLog::debug("LoggerPatternParser::finalizeConverter() CATEGORY converter.");
// $this->formattingInfo->dump();
$this->currentLiteral = '';
break;
case 'C':
$pc = new LoggerClassNamePatternConverter($this->formattingInfo, $this->extractPrecisionOption());
LoggerLog::debug("LoggerPatternParser::finalizeConverter() CLASSNAME converter.");
//$this->formattingInfo->dump();
$this->currentLiteral = '';
break;
case 'd':
$dateFormatStr = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ISO8601;
// ISO8601_DATE_FORMAT;
$dOpt = $this->extractOption();
if ($dOpt !== null) {
$dateFormatStr = $dOpt;
}
if ($dateFormatStr == 'ISO8601') {
$df = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ISO8601;
} elseif ($dateFormatStr == 'ABSOLUTE') {
$df = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ABSOLUTE;
} elseif ($dateFormatStr == 'DATE') {
$df = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_DATE;
} else {
$df = $dateFormatStr;
if ($df == null) {
$df = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ISO8601;
}
}
$pc = new LoggerDatePatternConverter($this->formattingInfo, $df);
$this->currentLiteral = '';
break;
case 'F':
$pc = new LoggerLocationPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_FILE_LOCATION_CONVERTER);
LoggerLog::debug("LoggerPatternParser::finalizeConverter() File name converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'l':
$pc = new LoggerLocationPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_FULL_LOCATION_CONVERTER);
LoggerLog::debug("LoggerPatternParser::finalizeConverter() Location converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'L':
$pc = new LoggerLocationPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_LINE_LOCATION_CONVERTER);
LoggerLog::debug("LoggerPatternParser::finalizeConverter() LINE NUMBER converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'm':
$pc = new LoggerBasicPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_MESSAGE_CONVERTER);
LoggerLog::debug("LoggerPatternParser::finalizeConverter() MESSAGE converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'M':
$pc = new LoggerLocationPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_METHOD_LOCATION_CONVERTER);
//LogLog.debug("METHOD converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'p':
$pc = new LoggerBasicPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_LEVEL_CONVERTER);
//LogLog.debug("LEVEL converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'r':
$pc = new LoggerBasicPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_RELATIVE_TIME_CONVERTER);
LoggerLog::debug("LoggerPatternParser::finalizeConverter() RELATIVE TIME converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 't':
$pc = new LoggerBasicPatternConverter($this->formattingInfo, LOG4PHP_LOGGER_PATTERN_PARSER_THREAD_CONVERTER);
LoggerLog::debug("LoggerPatternParser::finalizeConverter() THREAD converter.");
//formattingInfo.dump();
$this->currentLiteral = '';
break;
case 'u':
if ($this->i < $this->patternLength) {
$cNext = $this->pattern[$this->i];
if (ord($cNext) >= ord('0') && ord($cNext) <= ord('9')) {
$pc = new LoggerUserFieldPatternConverter($this->formattingInfo, (string) (ord($cNext) - ord('0')));
LoggerLog::debug("LoggerPatternParser::finalizeConverter() USER converter [{$cNext}].");
// formattingInfo.dump();
$this->currentLiteral = '';
$this->i++;
} else {
LoggerLog::warn("LoggerPatternParser::finalizeConverter() Unexpected char '{$cNext}' at position {$this->i}.");
}
}
//.........这里部分代码省略.........
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:101,代码来源:LoggerPatternParser.php
示例15: makeNewLoggerInstance
/**
* @abstract
* @param string $name
* @return Logger
*/
function makeNewLoggerInstance($name)
{
LoggerLog::warn("LoggerFactory:: makeNewLoggerInstance() is abstract.");
return null;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:10,代码来源:LoggerFactory.php
示例16: append
function append($event)
{
if ($this->layout !== null) {
$this->body = $this->layout->format($event);
}
if (stristr($this->body, "AWS was not able to validate the provided access credentials") || stristr($this->body, "The X509 Certificate you provided does not exist in our records") || stristr($this->body, "You are not subscribed to this service")) {
return;
}
$from = $this->from;
$to = $this->to;
if (!empty($this->body) and $from !== null and $to !== null and $this->layout !== null) {
$subject = $this->subject;
LoggerLog::debug("LoggerAppenderMail::close() sending mail from=[{$from}] to=[{$to}] subject=[{$subject}]");
mail($to, $subject, $this->layout->getHeader() . $this->body . $this->layout->getFooter(), "From: {$from}\r\n");
}
}
开发者ID:recipe,项目名称:scalr,代码行数:16,代码来源:class.LoggerAppenderEmergMail.php
示例17: setMaxFileSize
/**
* Set the maximum size that the output file is allowed to reach
* before being rolled over to backup files.
* <p>In configuration files, the <b>MaxFileSize</b> option takes an
* long integer in the range 0 - 2^63. You can specify the value
* with the suffixes "KB", "MB" or "GB" so that the integer is
* interpreted being expressed respectively in kilobytes, megabytes
* or gigabytes. For example, the value "10KB" will be interpreted
* as 10240.
*
* @param mixed $value
*/
function setMaxFileSize($value)
{
$maxFileSize = null;
$numpart = substr($value, 0, strlen($value) - 2);
$suffix = strtoupper(substr($value, -2));
switch ($suffix) {
case 'KB':
$maxFileSize = (int) ((int) $numpart * 1024);
break;
case 'MB':
$maxFileSize = (int) ((int) $numpart * 1024 * 1024);
break;
case 'GB':
$maxFileSize = (int) ((int) $numpart * 1024 * 1024 * 1024);
break;
default:
if (is_numeric($value)) {
$maxFileSize = (int) $value;
}
}
if ($maxFileSize === null) {
LoggerLog::debug("LoggerAppenderRollingFile::setMaxFileSize():value=[{$value}] wrong declaration");
} else {
$this->maxFileSize = abs($maxFileSize);
}
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:38,代码来源:LoggerAppenderRollingFile.php
示例18: format
/**
* Produces a formatted string as specified by the conversion pattern.
*
* @param LoggerLoggingEvent $event
* @return string
*/
function format($event)
{
LoggerLog::debug("LoggerPatternLayout::format()");
// Reset working stringbuffer
$this->sbuf = '';
$c = $this->head;
while ($c !== null) {
$c->format($this->sbuf, $event);
$c = $c->next;
}
return $this->sbuf;
}
开发者ID:rrsc,项目名称:freemed,代码行数:18,代码来源:LoggerPatternLayout.php
示例19: append
/**
* Do nothing.
* How I Love it !! :)
*
* @param LoggerLoggingEvent $event
*/
protected function append($event)
{
LoggerLog::debug("LoggerAppenderNull::append()");
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:10,代码来源:LoggerAppenderNull.php
示例20: activate
function activate()
{
LoggerLog::debug("LoggerOptionConverter::activate()");
if (method_exists($this->obj, 'activateoptions')) {
return call_user_func(array(&$this->obj, 'activateoptions'));
} else {
LoggerLog::debug("LoggerOptionConverter::activate() Nothing to activate.");
}
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:9,代码来源:LoggerPropertySetter.php
注:本文中的LoggerLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论