You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by ca...@apache.org on 2007/07/17 05:36:27 UTC
svn commit: r556801 [1/2] - in /incubator/log4php/trunk: ./ src/assembly/
src/main/php/ src/main/php/appenders/ src/main/php/config/
src/main/php/helpers/ src/main/php/layouts/ src/main/php/spi/
src/php5/examples/ src/site/ src/test/php/ src/test/php/a...
Author: carnold
Date: Mon Jul 16 20:36:21 2007
New Revision: 556801
URL: http://svn.apache.org/viewvc?view=rev&rev=556801
Log:
License and whitespace changes
Modified:
incubator/log4php/trunk/build.xml
incubator/log4php/trunk/pom.xml
incubator/log4php/trunk/src/assembly/bin.xml
incubator/log4php/trunk/src/main/php/Logger.php
incubator/log4php/trunk/src/main/php/LoggerAppender.php
incubator/log4php/trunk/src/main/php/LoggerHierarchy.php
incubator/log4php/trunk/src/main/php/LoggerLog.php
incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php
incubator/log4php/trunk/src/main/php/LoggerRoot.php
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderFile.php
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php
incubator/log4php/trunk/src/main/php/config/LoggerPropertySetter.php
incubator/log4php/trunk/src/main/php/helpers/LoggerOptionConverter.php
incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php
incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php
incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutTTCC.php
incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php
incubator/log4php/trunk/src/main/php/spi/LoggerLocationInfo.php
incubator/log4php/trunk/src/main/php/spi/LoggerLoggingEvent.php
incubator/log4php/trunk/src/php5/examples/cache.php
incubator/log4php/trunk/src/php5/examples/cache.properties
incubator/log4php/trunk/src/php5/examples/client.php
incubator/log4php/trunk/src/php5/examples/console.php
incubator/log4php/trunk/src/php5/examples/console.properties
incubator/log4php/trunk/src/php5/examples/dailyfile.php
incubator/log4php/trunk/src/php5/examples/dailyfile.properties
incubator/log4php/trunk/src/php5/examples/echo.php
incubator/log4php/trunk/src/php5/examples/echo.properties
incubator/log4php/trunk/src/php5/examples/file.php
incubator/log4php/trunk/src/php5/examples/file.properties
incubator/log4php/trunk/src/php5/examples/levelmatchfilter.php
incubator/log4php/trunk/src/php5/examples/levelrangefilter.php
incubator/log4php/trunk/src/php5/examples/levelrangefilter.xml
incubator/log4php/trunk/src/php5/examples/mail.php
incubator/log4php/trunk/src/php5/examples/mdc.php
incubator/log4php/trunk/src/php5/examples/ndc.php
incubator/log4php/trunk/src/php5/examples/php.php
incubator/log4php/trunk/src/php5/examples/php.properties
incubator/log4php/trunk/src/php5/examples/server.php
incubator/log4php/trunk/src/php5/examples/simple.php
incubator/log4php/trunk/src/php5/examples/stringmatchfilter.php
incubator/log4php/trunk/src/php5/examples/syslog.php
incubator/log4php/trunk/src/php5/examples/syslog.properties
incubator/log4php/trunk/src/site/site.xml
incubator/log4php/trunk/src/test/php/AllTests.php
incubator/log4php/trunk/src/test/php/LoggerBasicConfiguratorTest.php
incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
incubator/log4php/trunk/src/test/php/LoggerLogTest.php
incubator/log4php/trunk/src/test/php/LoggerManagerTest.php
incubator/log4php/trunk/src/test/php/LoggerRootTest.php
incubator/log4php/trunk/src/test/php/appenders/AllTests.php
incubator/log4php/trunk/src/test/php/appenders/LoggerAppenderConsoleTest.php
incubator/log4php/trunk/src/test/php/appenders/LoggerAppenderNullTest.php
incubator/log4php/trunk/src/test/php/or/AllTests.php
incubator/log4php/trunk/src/test/php/or/LoggerDefaultRendererTest.php
incubator/log4php/trunk/src/test/php/or/LoggerObjectRendererTest.php
incubator/log4php/trunk/src/test/php/or/LoggerRendererMapTest.php
incubator/log4php/trunk/src/test/php/spi/AllTests.php
incubator/log4php/trunk/src/test/php/spi/LoggerLoggingEventTest.php
Modified: incubator/log4php/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/build.xml?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/build.xml (original)
+++ incubator/log4php/trunk/build.xml Mon Jul 16 20:36:21 2007
@@ -19,52 +19,52 @@
<!-- Use Maven 2 to build or manually place ant-contrib (http://ant-contrib.sf.net) on path -->
<taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" />
-
+
<target name="compile-file">
- <exec executable="php" failonerror="true">
- <arg value="-l"/>
- <arg value="${src.php}"/>
- </exec>
- </target>
-
- <target name="compile">
- <foreach target="compile-file" param="src.php">
- <path>
- <fileset dir="." includes="src/main/php/**/*.php"/>
- </path>
- </foreach>
- </target>
+ <exec executable="php" failonerror="true">
+ <arg value="-l"/>
+ <arg value="${src.php}"/>
+ </exec>
+ </target>
+
+ <target name="compile">
+ <foreach target="compile-file" param="src.php">
+ <path>
+ <fileset dir="." includes="src/main/php/**/*.php"/>
+ </path>
+ </foreach>
+ </target>
- <target name="test-compile">
- <foreach target="compile-file" param="src.php">
- <path>
- <fileset dir="." includes="src/test/php/**/*.php"/>
- </path>
- </foreach>
- </target>
+ <target name="test-compile">
+ <foreach target="compile-file" param="src.php">
+ <path>
+ <fileset dir="." includes="src/test/php/**/*.php"/>
+ </path>
+ </foreach>
+ </target>
- <target name="test">
- <!-- PHPUnit3 must be installed for this to work.
- See http://www.phpunit.de -->
- <exec executable="phpunit" failonerror="true" dir="src/test/php">
- <arg value="AllTests"/>
- <arg value="AllTests.php"/>
- </exec>
- </target>
-
- <target name="apidocs">
- <!-- PHPDoc must be installed for this to work. -->
- <mkdir dir="target/site/apidocs"/>
- <exec executable="phpdoc" failonerror="true">
- <arg value="-d"/>
- <arg value="src/main/php"/>
- <arg value="-t"/>
- <arg value="target/site/apidocs"/>
- </exec>
- </target>
+ <target name="test">
+ <!-- PHPUnit3 must be installed for this to work.
+ See http://www.phpunit.de -->
+ <exec executable="phpunit" failonerror="true" dir="src/test/php">
+ <arg value="AllTests"/>
+ <arg value="AllTests.php"/>
+ </exec>
+ </target>
+
+ <target name="apidocs">
+ <!-- PHPDoc must be installed for this to work. -->
+ <mkdir dir="target/site/apidocs"/>
+ <exec executable="phpdoc" failonerror="true">
+ <arg value="-d"/>
+ <arg value="src/main/php"/>
+ <arg value="-t"/>
+ <arg value="target/site/apidocs"/>
+ </exec>
+ </target>
- <target name="fixcrlf">
- <fixcrlf srcdir="src" includes="**/*.php"/>
- </target>
+ <target name="fixcrlf">
+ <fixcrlf srcdir="." includes="**/*.php, **/*.xml, **/*.properties, **/*.ini" tab="remove"/>
+ </target>
</project>
Modified: incubator/log4php/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/pom.xml?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/pom.xml (original)
+++ incubator/log4php/trunk/pom.xml Mon Jul 16 20:36:21 2007
@@ -29,36 +29,36 @@
<url>http://issues.apache.org/jira/</url>
</issueManagement>
<ciManagement>
- <system>Gump</system>
- <url>http://vmgump.apache.org/gump/public/logging-log4php/logging-log4php/index.html</url>
+ <system>Gump</system>
+ <url>http://vmgump.apache.org/gump/public/logging-log4php/logging-log4php/index.html</url>
</ciManagement>
<mailingLists>
- <mailingList>
- <name>log4php-user</name>
- <subscribe>log4php-user-subscribe@logging.apache.org</subscribe>
- <unsubscribe>log4php-user-unsubscribe@logging.apache.org</unsubscribe>
- <post>log4php-user@logging.apache.org</post>
- <archive>http://mail-archives.apache.org/mod_mbox/logging-log4php-user/</archive>
- </mailingList>
- <mailingList>
- <name>log4php-dev</name>
- <subscribe>log4php-dev-subscribe@logging.apache.org</subscribe>
- <unsubscribe>log4php-dev-unsubscribe@logging.apache.org</unsubscribe>
- <post>log4php-dev@logging.apache.org</post>
- <archive>http://mail-archives.apache.org/mod_mbox/logging-log4php-dev/</archive>
- </mailingList>
+ <mailingList>
+ <name>log4php-user</name>
+ <subscribe>log4php-user-subscribe@logging.apache.org</subscribe>
+ <unsubscribe>log4php-user-unsubscribe@logging.apache.org</unsubscribe>
+ <post>log4php-user@logging.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/logging-log4php-user/</archive>
+ </mailingList>
+ <mailingList>
+ <name>log4php-dev</name>
+ <subscribe>log4php-dev-subscribe@logging.apache.org</subscribe>
+ <unsubscribe>log4php-dev-unsubscribe@logging.apache.org</unsubscribe>
+ <post>log4php-dev@logging.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/logging-log4php-dev/</archive>
+ </mailingList>
</mailingLists>
<licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
</licenses>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/log4php</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/log4php</developerConnection>
- <url>http://svn.apache.org/viewcvs.cgi/incubator/log4php</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/log4php</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/log4php</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/incubator/log4php</url>
</scm>
<organization>
<name>Apache Software Foundation</name>
@@ -80,7 +80,7 @@
<id>compile</id>
<configuration>
<tasks>
- <ant target="compile"/>
+ <ant target="compile"/>
</tasks>
</configuration>
<goals>
@@ -92,7 +92,7 @@
<id>test-compile</id>
<configuration>
<tasks>
- <ant target="test-compile"/>
+ <ant target="test-compile"/>
</tasks>
</configuration>
<goals>
@@ -104,19 +104,19 @@
<id>test</id>
<configuration>
<tasks>
- <ant target="test"/>
+ <ant target="test"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
- <execution>
+ <execution>
<phase>site</phase>
<id>site</id>
<configuration>
<tasks>
- <ant target="apidocs"/>
+ <ant target="apidocs"/>
<taskdef name="replaceregexp" classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp" />
<replaceregexp file="target/site/source-repository.html" match="/tags/[^ ]*" replace="/trunk" flags="g" />
</tasks>
@@ -138,8 +138,8 @@
<version>1.0b2</version>
</dependency>
</dependencies>
- </plugin>
- <plugin>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
@@ -154,7 +154,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
<dependencies>
@@ -185,7 +185,7 @@
</plugin>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
- <reportSets>
+ <reportSets>
<reportSet>
<reports>
<report>changes-report</report>
@@ -193,7 +193,7 @@
</reportSet>
</reportSets>
<configuration>
- <issueLinkTemplate>%URL%/browse/%ISSUE%</issueLinkTemplate>
+ <issueLinkTemplate>%URL%/browse/%ISSUE%</issueLinkTemplate>
</configuration>
</plugin>
</plugins>
Modified: incubator/log4php/trunk/src/assembly/bin.xml
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/assembly/bin.xml?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/assembly/bin.xml (original)
+++ incubator/log4php/trunk/src/assembly/bin.xml Mon Jul 16 20:36:21 2007
@@ -16,23 +16,23 @@
-->
<assembly>
- <id>bin</id>
- <formats>
- <format>zip</format>
- <format>tar.gz</format>
- </formats>
- <baseDirectory>apache-log4php-${project.version}</baseDirectory>
- <includeSiteDirectory>true</includeSiteDirectory>
- <fileSets>
- <fileSet>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>build.xml</include>
- <include>pom.xml</include>
- <include>src/**</include>
- </includes>
- </fileSet>
- </fileSets>
-
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ <format>tar.gz</format>
+ </formats>
+ <baseDirectory>apache-log4php-${project.version}</baseDirectory>
+ <includeSiteDirectory>true</includeSiteDirectory>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>LICENSE</include>
+ <include>NOTICE</include>
+ <include>build.xml</include>
+ <include>pom.xml</include>
+ <include>src/**</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
</assembly>
Modified: incubator/log4php/trunk/src/main/php/Logger.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/Logger.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/Logger.php (original)
+++ incubator/log4php/trunk/src/main/php/Logger.php Mon Jul 16 20:36:21 2007
@@ -1,10 +1,11 @@
<?php
/**
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -47,7 +48,7 @@
* appenders of their ancestors by default.
* @var boolean
*/
- protected $additive = true;
+ protected $additive = true;
/**
* @var string fully qualified class name
@@ -231,7 +232,7 @@
*/
public function getAllAppenders()
{
- return array_values($this->aai);
+ return array_values($this->aai);
}
/**
@@ -288,7 +289,7 @@
{
for($c = $this; $c != null; $c = $c->parent) {
if($c->getLevel() !== null)
- return $c->getLevel();
+ return $c->getLevel();
}
return null;
}
@@ -556,9 +557,9 @@
}
public function setParent($logger) {
- if ($logger instanceof Logger) {
- $this->parent = $logger;
- }
+ if ($logger instanceof Logger) {
+ $this->parent = $logger;
+ }
}
/**
Modified: incubator/log4php/trunk/src/main/php/LoggerAppender.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerAppender.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerAppender.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerAppender.php Mon Jul 16 20:36:21 2007
@@ -34,7 +34,7 @@
{
$class = basename($class);
if (!empty($class)) {
-
+
if (!class_exists($class))
include_once(LOG4PHP_DIR . "/appenders/{$class}.php");
if (class_exists($class))
Modified: incubator/log4php/trunk/src/main/php/LoggerHierarchy.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerHierarchy.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerHierarchy.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerHierarchy.php Mon Jul 16 20:36:21 2007
@@ -151,11 +151,11 @@
return isset($this->ht[$name]);
}
- /**
- * Not Implemented.
- * @param Logger $logger
- * @param LoggerAppender $appender
- */
+ /**
+ * Not Implemented.
+ * @param Logger $logger
+ * @param LoggerAppender $appender
+ */
public function fireAddAppenderEvent($logger, $appender)
{
return;
@@ -297,9 +297,9 @@
$enumLoggers = sizeof($loggers);
for ($i = 0; $i < $enumLoggers; $i++) {
$loggers[$i]->setLevel(null);
- $loggers[$i]->setAdditivity(true);
- $loggers[$i]->setResourceBundle(null);
- $loggers[$i]->removeAllAppenders();
+ $loggers[$i]->setAdditivity(true);
+ $loggers[$i]->setResourceBundle(null);
+ $loggers[$i]->removeAllAppenders();
}
$this->rendererMap->clear();
}
Modified: incubator/log4php/trunk/src/main/php/LoggerLog.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerLog.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerLog.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerLog.php Mon Jul 16 20:36:21 2007
@@ -27,7 +27,7 @@
*/
class LoggerLog {
- protected static $debug = false;
+ protected static $debug = false;
/**
* Log if debug is enabled.
Modified: incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php Mon Jul 16 20:36:21 2007
@@ -428,7 +428,7 @@
} else {
$root =& $hierarchy->getRootLogger();
// synchronized(root) {
- $this->parseCategory(
+ $this->parseCategory(
$props,
$root,
$effectivePrefix,
@@ -450,23 +450,23 @@
while(list($key,$value) = each($props)) {
if( strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_CATEGORY_PREFIX) === 0 or
strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_LOGGER_PREFIX) === 0) {
- if(strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_CATEGORY_PREFIX) === 0) {
+ if(strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_CATEGORY_PREFIX) === 0) {
$loggerName = substr($key, strlen(LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_CATEGORY_PREFIX));
- } elseif (strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_LOGGER_PREFIX) === 0) {
+ } elseif (strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_LOGGER_PREFIX) === 0) {
$loggerName = substr($key, strlen(LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_LOGGER_PREFIX));
}
$logger =& $hierarchy->getLogger($loggerName, $this->loggerFactory);
- // synchronized(logger) {
- $this->parseCategory($props, $logger, $key, $loggerName, $value);
- $this->parseAdditivityForLogger($props, $logger, $loggerName);
- // }
+ // synchronized(logger) {
+ $this->parseCategory($props, $logger, $key, $loggerName, $value);
+ $this->parseAdditivityForLogger($props, $logger, $loggerName);
+ // }
} elseif (strpos($key, LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_RENDERER_PREFIX) === 0) {
$renderedClass = substr($key, strlen(LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_RENDERER_PREFIX));
- $renderingClass = $value;
- if (method_exists($hierarchy, 'addrenderer')) { // ?
- LoggerRendererMap::addRenderer($hierarchy, $renderedClass, $renderingClass);
+ $renderingClass = $value;
+ if (method_exists($hierarchy, 'addrenderer')) { // ?
+ LoggerRendererMap::addRenderer($hierarchy, $renderedClass, $renderingClass);
+ }
}
- }
}
}
@@ -481,7 +481,7 @@
{
$value = LoggerOptionConverter::findAndSubst(
LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_ADDITIVITY_PREFIX . $loggerName,
- $props
+ $props
);
LoggerLog::debug(
"LoggerPropertyConfigurator::parseAdditivityForLogger() ".
@@ -523,7 +523,7 @@
if(!(@$value{0} == ',' || empty($value))) {
// just to be on the safe side...
if(sizeof($st) == 0)
- return;
+ return;
$levelStr = current($st);
LoggerLog::debug(
@@ -535,16 +535,16 @@
// null. We also check that the user has not specified inherited for the
// root category.
if('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
- if ($loggerName == LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_INTERNAL_ROOT_NAME) {
+ if ($loggerName == LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_INTERNAL_ROOT_NAME) {
LoggerLog::warn(
"LoggerPropertyConfigurator::parseCategory() ".
"The root logger cannot be set to null."
);
- } else {
- $logger->setLevel(null);
- }
+ } else {
+ $logger->setLevel(null);
+ }
} else {
- $logger->setLevel(LoggerOptionConverter::toLevel($levelStr, LoggerLevel::getLevelDebug()));
+ $logger->setLevel(LoggerOptionConverter::toLevel($levelStr, LoggerLevel::getLevelDebug()));
}
}
@@ -560,7 +560,7 @@
);
$appender =& $this->parseAppender($props, $appenderName);
if($appender !== null) {
- $logger->addAppender($appender);
+ $logger->addAppender($appender);
}
}
}
@@ -616,10 +616,10 @@
);
$layout = LoggerLayout::factory('LoggerLayoutSimple');
} else {
- $layout = LoggerLayout::factory($layoutClass);
+ $layout = LoggerLayout::factory($layoutClass);
- if($layout === null) {
- LoggerLog::warn(
+ if($layout === null) {
+ LoggerLog::warn(
"LoggerPropertyConfigurator::parseAppender() ".
"cannot create layout '$layoutClass'. Using Simple layout"
);
Modified: incubator/log4php/trunk/src/main/php/LoggerRoot.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerRoot.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerRoot.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerRoot.php Mon Jul 16 20:36:21 2007
@@ -67,7 +67,7 @@
*/
public function setLevel($level)
{
- if ($level != null) {
+ if ($level != null) {
$this->level = $level;
}
}
Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php (original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php Mon Jul 16 20:36:21 2007
@@ -90,7 +90,7 @@
public function close() {
if ($this->fp && $this->layout !== null) {
fwrite($this->fp, $this->layout->getFooter());
- fclose($this->fp);
+ fclose($this->fp);
}
$this->closed = true;
}
Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderFile.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderFile.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderFile.php (original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderFile.php Mon Jul 16 20:36:21 2007
@@ -46,9 +46,9 @@
*/
private $fp = false;
- public function __construct($name) {
- parent::__construct($name);
- $this->requiresLayout = true;
+ public function __construct($name) {
+ parent::__construct($name);
+ $this->requiresLayout = true;
}
public function activateOptions() {
@@ -67,8 +67,8 @@
public function close() {
if($this->fp and $this->layout !== null) {
- fwrite($this->fp, $this->layout->getFooter());
- }
+ fwrite($this->fp, $this->layout->getFooter());
+ }
$this->closeFile();
$this->closed = true;
Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php (original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php Mon Jul 16 20:36:21 2007
@@ -59,7 +59,7 @@
*/
public function __construct($name) {
parent::__construct($name);
- $this->requiresLayout = true;
+ $this->requiresLayout = true;
}
public function activateOptions() {
@@ -71,7 +71,7 @@
$to = $this->to;
if (!empty($this->body) and $from !== null and $to !== null and $this->layout !== null) {
- $subject = $this->subject;
+ $subject = $this->subject;
LoggerLog::debug("LoggerAppenderMail::close() sending mail from=[{$from}] to=[{$to}] subject=[{$subject}]");
mail(
$to, $subject,
Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php (original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php Mon Jul 16 20:36:21 2007
@@ -44,11 +44,11 @@
class LoggerAppenderSyslog extends LoggerAppenderSkeleton {
/**
- * The ident string is added to each message. Typically the name of your application.
- *
- * @var string Ident for your application
- */
- private $_ident = "Log4PHP Syslog-Event";
+ * The ident string is added to each message. Typically the name of your application.
+ *
+ * @var string Ident for your application
+ */
+ private $_ident = "Log4PHP Syslog-Event";
/**
* The priority parameter value indicates the level of importance of the message.
@@ -83,32 +83,32 @@
*/
private $_overridePriority;
- /**
+ /**
* Set the ident of the syslog message.
*
* @param string Ident
*/
- public function setIdent($ident) {
- $this->_ident = $ident;
+ public function setIdent($ident) {
+ $this->_ident = $ident;
}
/**
* Set the priority value for the syslog message.
*
- * @param const int Priority
+ * @param const int Priority
*/
- public function setPriority($priority) {
- $this->_priority = $priority;
+ public function setPriority($priority) {
+ $this->_priority = $priority;
}
/**
* Set the facility value for the syslog message.
*
- * @param const int Facility
+ * @param const int Facility
*/
public function setFacility($facility) {
- $this->_facility = $facility;
+ $this->_facility = $facility;
}
/**
@@ -118,7 +118,7 @@
* @param bool Override priority
*/
public function setOverridePriority($overridePriority) {
- $this->_overridePriority = $overridePriority;
+ $this->_overridePriority = $overridePriority;
}
/**
@@ -129,7 +129,7 @@
* @param string $option
*/
public function setOption($option) {
- $this->_option = $option;
+ $this->_option = $option;
}
@@ -158,7 +158,7 @@
// If the priority of a syslog message can be overridden by a value defined in the properties-file,
// use that value, else use the one that is defined in the code.
if($this->_overridePriority){
- syslog($this->_priority, $message);
+ syslog($this->_priority, $message);
} else {
if ($level->isGreaterOrEqual(LoggerLevel::getLevelFatal())) {
syslog(LOG_ALERT, $message);
Modified: incubator/log4php/trunk/src/main/php/config/LoggerPropertySetter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/config/LoggerPropertySetter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/config/LoggerPropertySetter.php (original)
+++ incubator/log4php/trunk/src/main/php/config/LoggerPropertySetter.php Mon Jul 16 20:36:21 2007
@@ -133,7 +133,7 @@
if (!method_exists($this->obj, $method)) {
LoggerLog::warn(
"LoggerOptionConverter::setProperty() No such setter method for [{$name}] property in " .
- get_class($this->obj) . "."
+ get_class($this->obj) . "."
);
} else {
return call_user_func(array(&$this->obj, $method), $value);
Modified: incubator/log4php/trunk/src/main/php/helpers/LoggerOptionConverter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerOptionConverter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerOptionConverter.php (original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerOptionConverter.php Mon Jul 16 20:36:21 2007
@@ -153,10 +153,10 @@
$hashIndex = strpos($value, '#');
if ($hashIndex === false) {
if("NULL" == strtoupper($value)) {
- return null;
+ return null;
} else {
- // no class name specified : use standard Level class
- return LoggerLevel::toLevel($value, $defaultValue);
+ // no class name specified : use standard Level class
+ return LoggerLevel::toLevel($value, $defaultValue);
}
}
@@ -167,7 +167,7 @@
// This is degenerate case but you never know.
if("NULL" == strtoupper($levelName)) {
- return null;
+ return null;
}
LoggerLog::debug("LoggerOptionConverter::toLevel():class=[{$clazz}]:pri=[{$levelName}]");
@@ -286,47 +286,47 @@
$j = strpos($val, LOG4PHP_OPTION_CONVERTER_DELIM_START, $i);
if ($j === false) {
LoggerLog::debug("LoggerOptionConverter::substVars() no more variables");
- // no more variables
- if ($i == 0) { // this is a simple string
+ // no more variables
+ if ($i == 0) { // this is a simple string
LoggerLog::debug("LoggerOptionConverter::substVars() simple string");
- return $val;
- } else { // add the tail string which contails no variables and return the result.
+ return $val;
+ } else { // add the tail string which contails no variables and return the result.
$sbuf .= substr($val, $i);
LoggerLog::debug("LoggerOptionConverter::substVars():sbuf=[{$sbuf}]. Returning sbuf");
return $sbuf;
- }
+ }
} else {
- $sbuf .= substr($val, $i, $j-$i);
+ $sbuf .= substr($val, $i, $j-$i);
LoggerLog::debug("LoggerOptionConverter::substVars():sbuf=[{$sbuf}]:i={$i}:j={$j}.");
- $k = strpos($val, LOG4PHP_OPTION_CONVERTER_DELIM_STOP, $j);
- if ($k === false) {
+ $k = strpos($val, LOG4PHP_OPTION_CONVERTER_DELIM_STOP, $j);
+ if ($k === false) {
LoggerLog::warn(
"LoggerOptionConverter::substVars() " .
"'{$val}' has no closing brace. Opening brace at position {$j}."
);
return '';
- } else {
- $j += LOG4PHP_OPTION_CONVERTER_DELIM_START_LEN;
- $key = substr($val, $j, $k - $j);
+ } else {
+ $j += LOG4PHP_OPTION_CONVERTER_DELIM_START_LEN;
+ $key = substr($val, $j, $k - $j);
// first try in System properties
- $replacement = LoggerOptionConverter::getSystemProperty($key, null);
- // then try props parameter
- if($replacement == null and $props !== null) {
- $replacement = @$props[$key];
- }
+ $replacement = LoggerOptionConverter::getSystemProperty($key, null);
+ // then try props parameter
+ if($replacement == null and $props !== null) {
+ $replacement = @$props[$key];
+ }
if(!empty($replacement)) {
- // Do variable substitution on the replacement string
- // such that we can solve "Hello ${x2}" as "Hello p1"
+ // Do variable substitution on the replacement string
+ // such that we can solve "Hello ${x2}" as "Hello p1"
// the where the properties are
- // x1=p1
+ // x1=p1
// x2=${x1}
- $recursiveReplacement = LoggerOptionConverter::substVars($replacement, $props);
- $sbuf .= $recursiveReplacement;
- }
- $i = $k + LOG4PHP_OPTION_CONVERTER_DELIM_STOP_LEN;
- }
+ $recursiveReplacement = LoggerOptionConverter::substVars($replacement, $props);
+ $sbuf .= $recursiveReplacement;
+ }
+ $i = $k + LOG4PHP_OPTION_CONVERTER_DELIM_STOP_LEN;
+ }
}
}
}
Modified: incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php (original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php Mon Jul 16 20:36:21 2007
@@ -24,8 +24,8 @@
* Used by {@link LoggerPatternConverter::spacePad()}.
*/
$GLOBALS['log4php.LoggerPatternConverter.spaces'] = array(" ", " ", " ", " ", //1,2,4,8 spaces
- " ", // 16 spaces
- " " ); // 32 spaces
+ " ", // 16 spaces
+ " " ); // 32 spaces
/**
* LoggerPatternConverter is an abstract class that provides the formatting
@@ -101,7 +101,7 @@
if($len > $this->max) {
$sbuf .= substr($s , 0, ($len - $this->max));
} elseif($len < $this->min) {
- if($this->leftAlign) {
+ if($this->leftAlign) {
$sbuf .= $s;
$this->spacePad($sbuf, ($this->min - $len));
} else {
@@ -111,7 +111,7 @@
} else {
$sbuf .= $s;
}
- }
+ }
/**
@@ -131,9 +131,9 @@
$length -= 32;
}
- for($i = 4; $i >= 0; $i--) {
+ for($i = 4; $i >= 0; $i--) {
if(($length & (1<<$i)) != 0) {
- $sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][$i];
+ $sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][$i];
}
}
@@ -181,20 +181,20 @@
case LOG4PHP_LOGGER_PATTERN_PARSER_RELATIVE_TIME_CONVERTER:
$timeStamp = $event->getTimeStamp();
$startTime = LoggerLoggingEvent::getStartTime();
- return (string)(int)($timeStamp * 1000 - $startTime * 1000);
+ return (string)(int)($timeStamp * 1000 - $startTime * 1000);
case LOG4PHP_LOGGER_PATTERN_PARSER_THREAD_CONVERTER:
- return $event->getThreadName();
+ return $event->getThreadName();
case LOG4PHP_LOGGER_PATTERN_PARSER_LEVEL_CONVERTER:
$level = $event->getLevel();
- return $level->toString();
+ return $level->toString();
case LOG4PHP_LOGGER_PATTERN_PARSER_NDC_CONVERTER:
- return $event->getNDC();
+ return $event->getNDC();
case LOG4PHP_LOGGER_PATTERN_PARSER_MESSAGE_CONVERTER:
- return $event->getRenderedMessage();
+ return $event->getRenderedMessage();
default:
return '';
@@ -357,13 +357,13 @@
$locationInfo = $event->getLocationInformation();
switch($this->type) {
case LOG4PHP_LOGGER_PATTERN_PARSER_FULL_LOCATION_CONVERTER:
- return $locationInfo->fullInfo;
+ return $locationInfo->fullInfo;
case LOG4PHP_LOGGER_PATTERN_PARSER_METHOD_LOCATION_CONVERTER:
- return $locationInfo->getMethodName();
+ return $locationInfo->getMethodName();
case LOG4PHP_LOGGER_PATTERN_PARSER_LINE_LOCATION_CONVERTER:
- return $locationInfo->getLineNumber();
+ return $locationInfo->getLineNumber();
case LOG4PHP_LOGGER_PATTERN_PARSER_FILE_LOCATION_CONVERTER:
- return $locationInfo->getFileName();
+ return $locationInfo->getFileName();
default:
return '';
}
@@ -416,20 +416,20 @@
{
$n = $this->getFullyQualifiedName($event);
if ($this->precision <= 0) {
- return $n;
+ return $n;
} else {
- $len = strlen($n);
+ $len = strlen($n);
- // We substract 1 from 'len' when assigning to 'end' to avoid out of
- // bounds exception in return r.substring(end+1, len). This can happen if
- // precision is 1 and the category name ends with a dot.
- $end = $len -1 ;
- for($i = $this->precision; $i > 0; $i--) {
- $end = strrpos(substr($n, 0, ($end - 1)), '.');
- if ($end == false)
- return $n;
- }
- return substr($n, ($end + 1), $len);
+ // We substract 1 from 'len' when assigning to 'end' to avoid out of
+ // bounds exception in return r.substring(end+1, len). This can happen if
+ // precision is 1 and the category name ends with a dot.
+ $end = $len -1 ;
+ for($i = $this->precision; $i > 0; $i--) {
+ $end = strrpos(substr($n, 0, ($end - 1)), '.');
+ if ($end == false)
+ return $n;
+ }
+ return substr($n, ($end + 1), $len);
}
}
}
Modified: incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php (original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php Mon Jul 16 20:36:21 2007
@@ -141,8 +141,8 @@
$end = strpos($this->pattern, '}' , $this->i);
if ($end !== false) {
$r = substr($this->pattern, ($this->i + 1), ($end - $this->i - 1));
- $this->i= $end + 1;
- return $r;
+ $this->i= $end + 1;
+ return $r;
}
}
return null;
@@ -158,11 +158,11 @@
$r = 0;
if ($opt !== null) {
if (is_numeric($opt)) {
- $r = (int)$opt;
- if($r <= 0) {
- LoggerLog::warn("Precision option ({$opt}) isn't a positive integer.");
- $r = 0;
- }
+ $r = (int)$opt;
+ if($r <= 0) {
+ LoggerLog::warn("Precision option ({$opt}) isn't a positive integer.");
+ $r = 0;
+ }
} else {
LoggerLog::warn("Category option \"{$opt}\" not a decimal integer.");
}
@@ -217,55 +217,55 @@
break;
case LOG4PHP_LOGGER_PATTERN_PARSER_CONVERTER_STATE:
// LoggerLog::debug("LoggerPatternParser::parse() state is 'LOG4PHP_LOGGER_PATTERN_PARSER_CONVERTER_STATE'");
- $this->currentLiteral .= $c;
- switch($c) {
- case '-':
+ $this->currentLiteral .= $c;
+ switch($c) {
+ case '-':
$this->formattingInfo->leftAlign = true;
break;
- case '.':
+ case '.':
$this->state = LOG4PHP_LOGGER_PATTERN_PARSER_DOT_STATE;
- break;
- default:
+ break;
+ default:
if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
- $this->formattingInfo->min = ord($c) - ord('0');
- $this->state = LOG4PHP_LOGGER_PATTERN_PARSER_MIN_STATE;
+ $this->formattingInfo->min = ord($c) - ord('0');
+ $this->state = LOG4PHP_LOGGER_PATTERN_PARSER_MIN_STATE;
} else {
$this->finalizeConverter($c);
}
- } // switch
+ } // switch
break;
case LOG4PHP_LOGGER_PATTERN_PARSER_MIN_STATE:
// LoggerLog::debug("LoggerPatternParser::parse() state is 'LOG4PHP_LOGGER_PATTERN_PARSER_MIN_STATE'");
- $this->currentLiteral .= $c;
+ $this->currentLiteral .= $c;
if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
$this->formattingInfo->min = ($this->formattingInfo->min * 10) + (ord($c) - ord('0'));
- } elseif ($c == '.') {
+ } elseif ($c == '.') {
$this->state = LOG4PHP_LOGGER_PATTERN_PARSER_DOT_STATE;
} else {
- $this->finalizeConverter($c);
- }
- break;
+ $this->finalizeConverter($c);
+ }
+ break;
case LOG4PHP_LOGGER_PATTERN_PARSER_DOT_STATE:
// LoggerLog::debug("LoggerPatternParser::parse() state is 'LOG4PHP_LOGGER_PATTERN_PARSER_DOT_STATE'");
- $this->currentLiteral .= $c;
+ $this->currentLiteral .= $c;
if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
$this->formattingInfo->max = ord($c) - ord('0');
- $this->state = LOG4PHP_LOGGER_PATTERN_PARSER_MAX_STATE;
+ $this->state = LOG4PHP_LOGGER_PATTERN_PARSER_MAX_STATE;
} else {
- LoggerLog::warn("LoggerPatternParser::parse() Error occured in position {$this->i}. Was expecting digit, instead got char \"{$c}\".");
- $this->state = LOG4PHP_LOGGER_PATTERN_PARSER_LITERAL_STATE;
+ LoggerLog::warn("LoggerPatternParser::parse() Error occured in position {$this->i}. Was expecting digit, instead got char \"{$c}\".");
+ $this->state = LOG4PHP_LOGGER_PATTERN_PARSER_LITERAL_STATE;
}
- break;
+ break;
case LOG4PHP_LOGGER_PATTERN_PARSER_MAX_STATE:
// LoggerLog::debug("LoggerPatternParser::parse() state is 'LOG4PHP_LOGGER_PATTERN_PARSER_MAX_STATE'");
- $this->currentLiteral .= $c;
+ $this->currentLiteral .= $c;
if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
$this->formattingInfo->max = ($this->formattingInfo->max * 10) + (ord($c) - ord('0'));
- } else {
- $this->finalizeConverter($c);
+ } else {
+ $this->finalizeConverter($c);
$this->state = LOG4PHP_LOGGER_PATTERN_PARSER_LITERAL_STATE;
- }
- break;
+ }
+ break;
} // switch
} // while
if(strlen($this->currentLiteral) != 0) {
@@ -296,7 +296,7 @@
$dOpt = $this->extractOption();
if($dOpt !== null)
- $dateFormatStr = $dOpt;
+ $dateFormatStr = $dOpt;
if ($dateFormatStr == 'ISO8601') {
$df = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ISO8601;
@@ -309,7 +309,7 @@
if ($df == null) {
$df = LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ISO8601;
}
- }
+ }
$pc = new LoggerDatePatternConverter($this->formattingInfo, $df);
$this->currentLiteral = '';
break;
@@ -353,13 +353,13 @@
break;
case 'u':
if($this->i < $this->patternLength) {
- $cNext = $this->pattern{$this->i};
+ $cNext = $this->pattern{$this->i};
if(ord($cNext) >= ord('0') and ord($cNext) <= ord('9')) {
- $pc = new LoggerUserFieldPatternConverter($this->formattingInfo, (string)(ord($cNext) - ord('0')));
+ $pc = new LoggerUserFieldPatternConverter($this->formattingInfo, (string)(ord($cNext) - ord('0')));
LoggerLog::debug("LoggerPatternParser::finalizeConverter() USER converter [{$cNext}].");
$this->currentLiteral = '';
- $this->i++;
- } else {
+ $this->i++;
+ } else {
LoggerLog::warn("LoggerPatternParser::finalizeConverter() Unexpected char '{$cNext}' at position {$this->i}.");
}
}
Modified: incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutTTCC.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutTTCC.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutTTCC.php (original)
+++ incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutTTCC.php Mon Jul 16 20:36:21 2007
@@ -94,7 +94,7 @@
}
public function activateOptions() {
- return;
+ return;
}
/**
@@ -219,7 +219,7 @@
if($this->contextPrinting) {
$ndc = $event->getNDC();
if($ndc != null) {
- $format .= $ndc.' ';
+ $format .= $ndc.' ';
}
}
Modified: incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php (original)
+++ incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php Mon Jul 16 20:36:21 2007
@@ -102,9 +102,9 @@
return LOG4PHP_LOGGER_FILTER_NEUTRAL;
}
- public function getNext() {
- return $this->next;
- }
+ public function getNext() {
+ return $this->next;
+ }
}
?>
Modified: incubator/log4php/trunk/src/main/php/spi/LoggerLocationInfo.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/spi/LoggerLocationInfo.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/spi/LoggerLocationInfo.php (original)
+++ incubator/log4php/trunk/src/main/php/spi/LoggerLocationInfo.php Mon Jul 16 20:36:21 2007
@@ -84,7 +84,7 @@
* Return the file name of the caller.
* <p>This information is not always available.
*/
- public function getFileName()
+ public function getFileName()
{
return ($this->fileName === null) ? LOG4PHP_LOGGER_LOCATION_INFO_NA : $this->fileName;
}
Modified: incubator/log4php/trunk/src/main/php/spi/LoggerLoggingEvent.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/spi/LoggerLoggingEvent.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/main/php/spi/LoggerLoggingEvent.php (original)
+++ incubator/log4php/trunk/src/main/php/spi/LoggerLoggingEvent.php Mon Jul 16 20:36:21 2007
@@ -32,7 +32,7 @@
*/
class LoggerLoggingEvent {
- private static $startTime;
+ private static $startTime;
/**
* @var string Fully Qualified Class Name of the calling category class.
@@ -143,7 +143,7 @@
$this->timeStamp = $timeStamp;
} else {
if (function_exists('microtime')) {
- // get microtime as float
+ // get microtime as float
$this->timeStamp = microtime(true);
} else {
$this->timeStamp = floatval(time());
@@ -174,7 +174,7 @@
while ($hop !== null) {
$className = @strtolower($hop['class']);
if ( !empty($className) and ($className == 'logger' or $className == 'loggercategory' or
- get_parent_class($className) == 'logger') or get_parent_class($className) == 'loggercategory') {
+ get_parent_class($className) == 'logger') or get_parent_class($className) == 'loggercategory') {
$locationInfo['line'] = $hop['line'];
$locationInfo['file'] = $hop['file'];
break;
@@ -273,7 +273,7 @@
{
if($this->renderedMessage === null and $this->message !== null) {
if (is_string($this->message)) {
- $this->renderedMessage = $this->message;
+ $this->renderedMessage = $this->message;
} else {
if ($this->logger !== null) {
$repository = $this->logger->getLoggerRepository();
@@ -282,10 +282,10 @@
}
if (method_exists($repository, 'getRendererMap')) {
$rendererMap = $repository->getRendererMap();
- $this->renderedMessage= $rendererMap->findAndRender($this->message);
- } else {
- $this->renderedMessage = (string)$this->message;
- }
+ $this->renderedMessage= $rendererMap->findAndRender($this->message);
+ } else {
+ $this->renderedMessage = (string)$this->message;
+ }
}
}
return $this->renderedMessage;
@@ -301,7 +301,7 @@
public static function getStartTime() {
if (!isset(self::$startTime)) {
if (function_exists('microtime')) {
- // microtime as float
+ // microtime as float
self::$startTime = microtime(true);
} else {
self::$startTime = floatval(time());
Modified: incubator/log4php/trunk/src/php5/examples/cache.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/cache.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/cache.php (original)
+++ incubator/log4php/trunk/src/php5/examples/cache.php Mon Jul 16 20:36:21 2007
@@ -1 +1,18 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'cache.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$cache = dirname(__FILE__).'/tmp/hierarchy.cache';
if(!file_exists($cache)) {
$hierarchy = LoggerManager::getLoggerRepository();
file_put_contents($cache, serialize($hierarchy));
}
$hierarchy = unserialize(file_get_contents($cache));
$logger = $hierarchy->getRootLogger();
$logger->debug('Debug message from cached logger');
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'cache.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+
+$cache = dirname(__FILE__).'/tmp/hierarchy.cache';
+
+if(!file_exists($cache)) {
+ $hierarchy = LoggerManager::getLoggerRepository();
+ file_put_contents($cache, serialize($hierarchy));
+}
+$hierarchy = unserialize(file_get_contents($cache));
+
+$logger = $hierarchy->getRootLogger();
+
+$logger->debug('Debug message from cached logger');
+?>
Modified: incubator/log4php/trunk/src/php5/examples/cache.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/cache.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/cache.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/cache.properties Mon Jul 16 20:36:21 2007
@@ -1,4 +1,4 @@
; cache.properties
log4php.appender.default = LoggerAppenderEcho
log4php.appender.default.layout = LoggerLayoutSimple
-log4php.rootLogger = DEBUG, default
\ No newline at end of file
+log4php.rootLogger = DEBUG, default
Modified: incubator/log4php/trunk/src/php5/examples/client.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/client.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/client.php (original)
+++ incubator/log4php/trunk/src/php5/examples/client.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'client.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->info("Hello World!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'client.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->info("Hello World!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/console.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/console.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/console.php (original)
+++ incubator/log4php/trunk/src/php5/examples/console.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'console.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Hello World!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'console.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Hello World!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/console.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/console.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/console.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/console.properties Mon Jul 16 20:36:21 2007
@@ -2,4 +2,4 @@
log4php.appender.console = LoggerAppenderConsole
log4php.appender.console.target = STDOUT
log4php.appender.console.layout = LoggerLayoutSimple
-log4php.rootLogger = DEBUG, console
\ No newline at end of file
+log4php.rootLogger = DEBUG, console
Modified: incubator/log4php/trunk/src/php5/examples/dailyfile.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/dailyfile.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/dailyfile.php (original)
+++ incubator/log4php/trunk/src/php5/examples/dailyfile.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'dailyfile.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Hello World!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'dailyfile.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Hello World!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/dailyfile.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/dailyfile.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/dailyfile.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/dailyfile.properties Mon Jul 16 20:36:21 2007
@@ -3,4 +3,4 @@
log4php.appender.default.layout = LoggerLayoutTTCC
log4php.appender.default.datePattern = Ymd
log4php.appender.default.file = tmp/daily_%s.log
-log4php.rootLogger = DEBUG, default
\ No newline at end of file
+log4php.rootLogger = DEBUG, default
Modified: incubator/log4php/trunk/src/php5/examples/echo.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/echo.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/echo.php (original)
+++ incubator/log4php/trunk/src/php5/examples/echo.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'echo.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Hello World!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'echo.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Hello World!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/echo.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/echo.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/echo.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/echo.properties Mon Jul 16 20:36:21 2007
@@ -1,4 +1,4 @@
; echo.properties
log4php.appender.default = LoggerAppenderEcho
log4php.appender.default.layout = LoggerLayoutSimple
-log4php.rootLogger = DEBUG, default
\ No newline at end of file
+log4php.rootLogger = DEBUG, default
Modified: incubator/log4php/trunk/src/php5/examples/file.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/file.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/file.php (original)
+++ incubator/log4php/trunk/src/php5/examples/file.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'file.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Hello World!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'file.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Hello World!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/file.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/file.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/file.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/file.properties Mon Jul 16 20:36:21 2007
@@ -2,4 +2,4 @@
log4php.appender.default = LoggerAppenderFile
log4php.appender.default.file = tmp/file.log
log4php.appender.default.layout = LoggerLayoutTTCC
-log4php.rootLogger = DEBUG, default
\ No newline at end of file
+log4php.rootLogger = DEBUG, default
Modified: incubator/log4php/trunk/src/php5/examples/levelmatchfilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/levelmatchfilter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/levelmatchfilter.php (original)
+++ incubator/log4php/trunk/src/php5/examples/levelmatchfilter.php Mon Jul 16 20:36:21 2007
@@ -1 +1,10 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR.'/xml/LoggerDOMConfigurator');
define('LOG4PHP_CONFIGURATION', 'levelmatchfilter.xml');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Matching and will be rejected");
$logger->info("Not matching and will be accepted");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR.'/xml/LoggerDOMConfigurator');
+define('LOG4PHP_CONFIGURATION', 'levelmatchfilter.xml');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Matching and will be rejected");
+$logger->info("Not matching and will be accepted");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/levelrangefilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/levelrangefilter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/levelrangefilter.php (original)
+++ incubator/log4php/trunk/src/php5/examples/levelrangefilter.php Mon Jul 16 20:36:21 2007
@@ -1 +1,13 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR.'/xml/LoggerDOMConfigurator');
define('LOG4PHP_CONFIGURATION', 'levelrangefilter.xml');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("This is a debug message");
$logger->info("This is an info message");
$logger->warn("This is a warning");
$logger->error("This is an error");
$logger->fatal("This is a fatal error");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR.'/xml/LoggerDOMConfigurator');
+define('LOG4PHP_CONFIGURATION', 'levelrangefilter.xml');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("This is a debug message");
+$logger->info("This is an info message");
+$logger->warn("This is a warning");
+$logger->error("This is an error");
+$logger->fatal("This is a fatal error");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/levelrangefilter.xml
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/levelrangefilter.xml?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/levelrangefilter.xml (original)
+++ incubator/log4php/trunk/src/php5/examples/levelrangefilter.xml Mon Jul 16 20:36:21 2007
@@ -6,7 +6,7 @@
<layout class="LoggerLayoutTTCC"/>
<filter class="LoggerLevelRangeFilter">
<param name="LevelMin" value="ERROR" />
- <param name="LevelMax" value="FATAL" />
+ <param name="LevelMax" value="FATAL" />
<param name="AcceptOnMatch" value="false" />
</filter>
</appender>
Modified: incubator/log4php/trunk/src/php5/examples/mail.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/mail.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/mail.php (original)
+++ incubator/log4php/trunk/src/php5/examples/mail.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'mail.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->fatal("Some critical message!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'mail.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->fatal("Some critical message!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/mdc.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/mdc.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/mdc.php (original)
+++ incubator/log4php/trunk/src/php5/examples/mdc.php Mon Jul 16 20:36:21 2007
@@ -1 +1,11 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'mdc.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
LoggerMDC::put('username', 'knut');
$logger = LoggerManager::getRootLogger();
$logger->debug("Testing MDC");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'mdc.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+
+LoggerMDC::put('username', 'knut');
+
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Testing MDC");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/ndc.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/ndc.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/ndc.php (original)
+++ incubator/log4php/trunk/src/php5/examples/ndc.php Mon Jul 16 20:36:21 2007
@@ -1 +1,15 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'mdc.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
LoggerNDC::push('Context Message');
$logger->debug("Testing NDC");
LoggerNDC::pop();
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'mdc.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+
+$logger = LoggerManager::getRootLogger();
+
+LoggerNDC::push('Context Message');
+
+$logger->debug("Testing NDC");
+
+LoggerNDC::pop();
+
+?>
Modified: incubator/log4php/trunk/src/php5/examples/php.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/php.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/php.php (original)
+++ incubator/log4php/trunk/src/php5/examples/php.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'php.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Hello PHP!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'php.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Hello PHP!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/php.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/php.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/php.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/php.properties Mon Jul 16 20:36:21 2007
@@ -1,4 +1,4 @@
; php.properties
log4php.appender.default = LoggerAppenderPhp
log4php.appender.default.layout = LoggerLayoutSimple
-log4php.rootLogger = DEBUG, default
\ No newline at end of file
+log4php.rootLogger = DEBUG, default
Modified: incubator/log4php/trunk/src/php5/examples/server.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/server.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/server.php (original)
+++ incubator/log4php/trunk/src/php5/examples/server.php Mon Jul 16 20:36:21 2007
@@ -1 +1,55 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'server.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
require_once 'Net/Server.php';
require_once 'Net/Server/Handler.php';
class Net_Server_Handler_Log extends Net_Server_Handler {
var $hierarchy;
function onStart() {
$this->hierarchy = LoggerManager::getLoggerRepository();
}
function onReceiveData($clientId = 0, $data = "") {
$events = $this->getEvents($data);
foreach($events as $event) {
$root = $this->hierarchy->getRootLogger();
if($event->getLoggerName() === 'root') {
$root->callAppenders($event);
} else {
$loggers = $this->hierarchy->getCurrentLoggers();
foreach($loggers as $logger) {
$root->callAppenders($event);
$appenders = $logger->getAllAppenders();
foreach($appenders as $appender) {
$appender->doAppend($event);
}
}
}
}
}
function getEvents($data) {
preg_match('/^(O:\d+)
/', $data, $parts);
$events = split($parts[1], $data);
array_shift($events);
$size = count($events);
for($i=0; $i<$size; $i++) {
$events[$i] = unserialize($parts[1].$events[$i]);
}
return $events;
}
}
$host = '127.0.0.1';
$port = 9090;
//$server =& Net_Server::create('fork', $host, $port);
$server =& Net_Server::create('sequential', $host, $port);
$handler =& new Net_Server_Handler_Log();
$server->setCallbackObject($handler);
$server->start();
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'server.properties');
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+
+require_once 'Net/Server.php';
+require_once 'Net/Server/Handler.php';
+
+class Net_Server_Handler_Log extends Net_Server_Handler {
+
+ var $hierarchy;
+
+ function onStart() {
+ $this->hierarchy = LoggerManager::getLoggerRepository();
+ }
+
+ function onReceiveData($clientId = 0, $data = "") {
+ $events = $this->getEvents($data);
+ foreach($events as $event) {
+ $root = $this->hierarchy->getRootLogger();
+ if($event->getLoggerName() === 'root') {
+ $root->callAppenders($event);
+ } else {
+ $loggers = $this->hierarchy->getCurrentLoggers();
+ foreach($loggers as $logger) {
+ $root->callAppenders($event);
+ $appenders = $logger->getAllAppenders();
+ foreach($appenders as $appender) {
+ $appender->doAppend($event);
+ }
+ }
+ }
+ }
+ }
+
+ function getEvents($data) {
+ preg_match('/^(O:\d+)/', $data, $parts);
+ $events = split($parts[1], $data);
+ array_shift($events);
+ $size = count($events);
+ for($i=0; $i<$size; $i++) {
+ $events[$i] = unserialize($parts[1].$events[$i]);
+ }
+ return $events;
+ }
+}
+
+$host = '127.0.0.1';
+$port = 9090;
+//$server =& Net_Server::create('fork', $host, $port);
+$server =& Net_Server::create('sequential', $host, $port);
+$handler =& new Net_Server_Handler_Log();
+$server->setCallbackObject($handler);
+$server->start();
+?>
Modified: incubator/log4php/trunk/src/php5/examples/simple.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/simple.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/simple.php (original)
+++ incubator/log4php/trunk/src/php5/examples/simple.php Mon Jul 16 20:36:21 2007
@@ -1 +1,28 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
require_once LOG4PHP_DIR.'/LoggerManager.php';
class Log4phpTest {
private $_logger;
public function Log4phpTest() {
$this->_logger = LoggerManager::getLogger('Log4phpTest');
$this->_logger->debug('Hello!');
}
}
function Log4phpTestFunction() {
$logger = LoggerManager::getLogger('Log4phpTestFunction');
$logger->debug('Hello again!');
}
$test = new Log4phpTest();
Log4phpTestFunction();
// Safely close all appenders with...
LoggerManager::shutdown();
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+
+class Log4phpTest {
+
+ private $_logger;
+
+ public function Log4phpTest() {
+ $this->_logger = LoggerManager::getLogger('Log4phpTest');
+ $this->_logger->debug('Hello!');
+ }
+
+}
+
+function Log4phpTestFunction() {
+ $logger = LoggerManager::getLogger('Log4phpTestFunction');
+ $logger->debug('Hello again!');
+}
+
+$test = new Log4phpTest();
+Log4phpTestFunction();
+
+// Safely close all appenders with...
+LoggerManager::shutdown();
+
+?>
Modified: incubator/log4php/trunk/src/php5/examples/stringmatchfilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/stringmatchfilter.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/stringmatchfilter.php (original)
+++ incubator/log4php/trunk/src/php5/examples/stringmatchfilter.php Mon Jul 16 20:36:21 2007
@@ -1 +1,10 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR.'/xml/LoggerDOMConfigurator');
define('LOG4PHP_CONFIGURATION', 'stringmatchfilter.xml');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->debug("Some text to match that will be rejected");
$logger->info("Some other text that will be accepted");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATOR_CLASS', LOG4PHP_DIR.'/xml/LoggerDOMConfigurator');
+define('LOG4PHP_CONFIGURATION', 'stringmatchfilter.xml');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->debug("Some text to match that will be rejected");
+$logger->info("Some other text that will be accepted");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/syslog.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/syslog.php?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/syslog.php (original)
+++ incubator/log4php/trunk/src/php5/examples/syslog.php Mon Jul 16 20:36:21 2007
@@ -1 +1,8 @@
-<?php
define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
define('LOG4PHP_CONFIGURATION', 'syslog.properties');
require_once LOG4PHP_DIR.'/LoggerManager.php';
$logger = LoggerManager::getRootLogger();
$logger->fatal("Hello World!");
?>
\ No newline at end of file
+<?php
+define('LOG4PHP_DIR', dirname(__FILE__).'/../log4php');
+define('LOG4PHP_CONFIGURATION', 'syslog.properties');
+
+require_once LOG4PHP_DIR.'/LoggerManager.php';
+$logger = LoggerManager::getRootLogger();
+$logger->fatal("Hello World!");
+?>
Modified: incubator/log4php/trunk/src/php5/examples/syslog.properties
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/php5/examples/syslog.properties?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/php5/examples/syslog.properties (original)
+++ incubator/log4php/trunk/src/php5/examples/syslog.properties Mon Jul 16 20:36:21 2007
@@ -3,4 +3,4 @@
log4php.appender.default.layout = LoggerLayoutSimple
log4php.appender.default.ident = log4php-test
log4php.appender.default.facility = LOG_LOCAL0
-log4php.rootLogger = DEBUG, default
\ No newline at end of file
+log4php.rootLogger = DEBUG, default
Modified: incubator/log4php/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/site/site.xml?view=diff&rev=556801&r1=556800&r2=556801
==============================================================================
--- incubator/log4php/trunk/src/site/site.xml (original)
+++ incubator/log4php/trunk/src/site/site.xml Mon Jul 16 20:36:21 2007
@@ -28,28 +28,28 @@
<item name="log4php" href="http://incubator.apache.org:80/log4php/"/>
</breadcrumbs>
- <menu name="Get log4php">
- <item name="Download" href="/download.html"/>
- <item name="Changes" href="/changes-report.html"/>
- <item name="License" href="/license.html"/>
- </menu>
+ <menu name="Get log4php">
+ <item name="Download" href="/download.html"/>
+ <item name="Changes" href="/changes-report.html"/>
+ <item name="License" href="/license.html"/>
+ </menu>
- <menu name="About log4php">
- <item name="What is it?" href="/index.html"/>
- <item name="Quick start" href="/qsg.html"/>
- <item name="Usage" href="/usage.html"/>
- <item name="Roadmap" href="/roadmap.html"/>
- <item name="PHPDoc" href="/apidocs/index.html"/>
- </menu>
+ <menu name="About log4php">
+ <item name="What is it?" href="/index.html"/>
+ <item name="Quick start" href="/qsg.html"/>
+ <item name="Usage" href="/usage.html"/>
+ <item name="Roadmap" href="/roadmap.html"/>
+ <item name="PHPDoc" href="/apidocs/index.html"/>
+ </menu>
- <menu name="Community">
- <item name="Mailing Lists" href="/mail-lists.html"/>
- <item name="Issue Tracking" href="/issue-tracking.html"/>
- </menu>
-
- <menu name="Development">
- <item name="Repository" href="/source-repository.html"/>
- <item name="Continuous Integration" href="/integration.html"/>
- </menu>
+ <menu name="Community">
+ <item name="Mailing Lists" href="/mail-lists.html"/>
+ <item name="Issue Tracking" href="/issue-tracking.html"/>
+ </menu>
+
+ <menu name="Development">
+ <item name="Repository" href="/source-repository.html"/>
+ <item name="Continuous Integration" href="/integration.html"/>
+ </menu>
</body>
</project>