Author: carnold
Date: Mon Jul 23 08:30:51 2007
New Revision: 558777

URL: http://svn.apache.org/viewvc?view=rev&rev=558777
Log:
Fix usage.html, tweak index.html and changes.html

Added:
    incubator/log4php/trunk/src/site/apt/usage.apt
      - copied, changed from r558219, 
incubator/log4php/trunk/src/site/xdoc/usage.xml
Removed:
    incubator/log4php/trunk/src/site/xdoc/usage.xml
Modified:
    incubator/log4php/trunk/src/changes/changes.xml
    incubator/log4php/trunk/src/site/apt/index.apt

Modified: incubator/log4php/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/changes/changes.xml?view=diff&rev=558777&r1=558776&r2=558777
==============================================================================
--- incubator/log4php/trunk/src/changes/changes.xml (original)
+++ incubator/log4php/trunk/src/changes/changes.xml Mon Jul 23 08:30:51 2007
@@ -20,10 +20,10 @@
     <title>Apache log4php.</title>
   </properties>
   <body>
-    <release version="2.0" date="2007-12-31" description="Initial release">
-      <action issue="LOG4PHP-1" type="add">
-Some sample bug report.
-      </action>
+    <release version="2.0" description="PHP 5 compatibility">
+      <action type="fix">Maven 2.0 build</action>
+      <action type="fix">Updated source file headers with current ASF 
notice</action>
+      <action type="fix">PHP 5 compatibility modification.</action>
     </release>
   </body>
 </document>

Modified: incubator/log4php/trunk/src/site/apt/index.apt
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/site/apt/index.apt?view=diff&rev=558777&r1=558776&r2=558777
==============================================================================
--- incubator/log4php/trunk/src/site/apt/index.apt (original)
+++ incubator/log4php/trunk/src/site/apt/index.apt Mon Jul 23 08:30:51 2007
@@ -18,8 +18,16 @@
  ------
  ------
 
-   log4php is a PHP port of log4j.
-   
+   Log4php is logging framework for PHP undergoing incubation at the Apache 
Software Foundation (ASF), 
+   sponsored by the Apache Logging Services project. 
+   Incubation is required of all newly accepted projects until a further 
review 
+   indicates that the infrastructure, communications, and decision making 
process 
+   have stabilized in a manner consistent with other successful ASF projects. 
+   While incubation status is not necessarily a reflection of the completeness 
or 
+   stability of the code, it does indicate that the project has yet to be 
+   fully endorsed by the ASF. 
+
+
    log4php supports:
    
    * Configuration through xml and properties file (same structure as log4j).
@@ -33,11 +41,3 @@
 
    * Switchable internal debug.
 
-   Log4php is an effort undergoing incubation at the Apache Software 
Foundation (ASF), 
-   sponsored by the Apache Logging Services project. 
-   Incubation is required of all newly accepted projects until a further 
review 
-   indicates that the infrastructure, communications, and decision making 
process 
-   have stabilized in a manner consistent with other successful ASF projects. 
-   While incubation status is not necessarily a reflection of the completeness 
or 
-   stability of the code, it does indicate that the project has yet to be 
-   fully endorsed by the ASF. 

Copied: incubator/log4php/trunk/src/site/apt/usage.apt (from r558219, 
incubator/log4php/trunk/src/site/xdoc/usage.xml)
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/site/apt/usage.apt?view=diff&rev=558777&p1=incubator/log4php/trunk/src/site/xdoc/usage.xml&r1=558219&p2=incubator/log4php/trunk/src/site/apt/usage.apt&r2=558777
==============================================================================
--- incubator/log4php/trunk/src/site/xdoc/usage.xml (original)
+++ incubator/log4php/trunk/src/site/apt/usage.apt Mon Jul 23 08:30:51 2007
@@ -1,144 +1,142 @@
-<?xml version="1.0"?>
+~~ 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
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+ ------
+ Apache log4php usage example
+ ------
+ ------
+ ------
 
-<document>
-    <properties>
-        <author email="marco at apache dot org">Marco Vassura</author>
-        <title>Log4php Usage Example</title>
-    </properties>
-    <meta name="keywords" content="php, java, logging, tracing, component, 
framework, API, log4php"/>
-    <body>
-        <section name="Log4php Usage Example">
-            <code><![CDATA[<font color="#000000">
-                    <font color="#0000BB">&lt;?php 
-                    <br />
-                    <br /></font><font color="#FF8000">/**
-                    <br /> * This is a log4php usage example file
-                    <br /> *
-                    <br /> * @version $Revision$
-                    <br /> * @author Marco V. &lt;[EMAIL PROTECTED]&gt;
-                    <br /> */
-                    <br />
-                    <br />/**
-                    <br /> * Set LOG4PHP_DIR to Your log4php root dir or it 
will
-                    <br /> * be set automatically at the first require_once().
-                    <br /> * Here 'log4php' is an 'include_path' subdir.
-                    <br /> */
-                    <br /></font><font color="#0000BB">define</font><font 
color="#007700">(</font><font color="#DD0000">'LOG4PHP_DIR'</font><font 
color="#007700">, </font><font color="#DD0000">'log4php'</font><font 
color="#007700">);
-                    <br />
-                    <br /></font><font color="#FF8000">/*
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;&nbsp;If you want to 
use a custom Configurator,
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set 
the LOG4PHP_CONFIGURATOR_CLASS constants to Your Configurator class file.
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The 
class name must have the same base name of the classfile.
-                    <br />
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ex: 
define('LOG4PHP_CONFIGURATOR_CLASS', '/my/path/LoggerMyConfigurator');
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log4php will try to include 
'/my/path/LoggerMyConfigurator.php'
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and 
instantiate a 'LoggerMyConfigurator' class.
-                    <br />
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;&nbsp;If you want to 
use a configuration file that's not the default,
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set 
the LOG4PHP_CONFIGURATION constants to Your configuration filename.
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ex: 
define('LOG4PHP_CONFIGURATION', '/my/path/my_config.conf');
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note 
that if config extension is NOT .xml and LOG4PHP_CONFIGURATOR_CLASS
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is 
not defined, the LoggerPropertyConfigurator will be used.&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;&nbsp;If you want to 
bypass the initial configuration procedure, set the 
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'LOG4PHP_DEFAULT_INIT_OVERRIDE'
 to true.
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ex: 
define('LOG4PHP_DEFAULT_INIT_OVERRIDE', true);
-                    <br />*/
-                    <br />
-                    <br />
-                    <br /></font><font 
color="#007700">require_once(</font><font color="#0000BB">LOG4PHP_DIR 
</font><font color="#007700">. </font><font 
color="#DD0000">'/LoggerManager.php'</font><font color="#007700">);
-                    <br /></font><font color="#FF8000">/* 
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;Or You can use:
-                    <br />&nbsp;&nbsp;&nbsp;
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require_once('/my/log4php/path/LoggerManager.php');
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;and LOG4PHP_DIR will be 
automatically set to '/my/log4php/path'.
-                    <br />*/
-                    <br />
-                    <br />
-                    <br /></font><font color="#007700">class </font><font 
color="#0000BB">Test </font><font color="#007700">{
-                    <br />
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;var </font><font 
color="#0000BB">$logger</font><font color="#007700">;
-                    <br />
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;function </font><font 
color="#0000BB">Test</font><font color="#007700">()
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;{
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger </font><font color="#007700">=&amp; </font><font 
color="#0000BB">LoggerManager</font><font color="#007700">::</font><font 
color="#0000BB">getLogger</font><font color="#007700">(</font><font 
color="#DD0000">'Test'</font><font color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;}
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;function </font><font 
color="#0000BB">testLog</font><font color="#007700">()
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;{
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">debug</font><font color="#007700">(</font><font 
color="#DD0000">'this is a DEBUG log generated by Test::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">info</font><font color="#007700">(</font><font 
color="#DD0000">'this is an INFO log generated by Test::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">warn</font><font color="#007700">(</font><font 
color="#DD0000">'this is a WARN log generated by Test::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">error</font><font color="#007700">(</font><font 
color="#DD0000">'this is an ERROR log generated by Test::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">fatal</font><font color="#007700">(</font><font 
color="#DD0000">'this is a FATAL log generated by Test::testLog() 
class'</font><font 
color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;}
-                    <br />
-                    <br />}
-                    <br />
-                    <br />class </font><font color="#0000BB">TestTest 
</font><font color="#007700">extends </font><font color="#0000BB">test 
</font><font color="#007700">{
-                    <br />
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;var </font><font 
color="#0000BB">$logger</font><font color="#007700">;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;function </font><font 
color="#0000BB">TestTest</font><font color="#007700">()
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;{
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">Test</font><font color="#007700">();&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger </font><font color="#007700">=&amp; </font><font 
color="#0000BB">LoggerManager</font><font color="#007700">::</font><font 
color="#0000BB">getLogger</font><font color="#007700">(</font><font 
color="#DD0000">'Test.Test'</font><font color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;}
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;function </font><font 
color="#0000BB">testLog</font><font color="#007700">()
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;{
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">LoggerNDC</font><font color="#007700">::</font><font 
color="#0000BB">push</font><font color="#007700">(</font><font 
color="#DD0000">'NDC generated by TestTest::testLog()'</font><font 
color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">debug</font><font color="#007700">(</font><font 
color="#DD0000">'this is a DEBUG log generated by TestTest::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">info</font><font color="#007700">(</font><font 
color="#DD0000">'this is an INFO log generated by TestTest::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">warn</font><font color="#007700">(</font><font 
color="#DD0000">'this is a WARN log generated by TestTest::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">error</font><font color="#007700">(</font><font 
color="#DD0000">'this is an ERROR log generated by TestTest::testLog() 
class'</font><font color="#007700">);
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$this</font><font color="#007700">-&gt;</font><font 
color="#0000BB">logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">fatal</font><font color="#007700">(</font><font 
color="#DD0000">'this is a FATAL log generated by TestTest::testLog() 
class'</font><font color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br 
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">LoggerNDC</font><font color="#007700">::</font><font 
color="#0000BB">pop</font><font 
color="#007700">();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;}
-                    <br />
-                    <br />} 
-                    <br />
-                    <br />function </font><font 
color="#0000BB">Bar</font><font color="#007700">()
-                    <br />{
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$logger </font><font color="#007700">=&amp; </font><font 
color="#0000BB">LoggerManager</font><font color="#007700">::</font><font 
color="#0000BB">getLogger</font><font color="#007700">(</font><font 
color="#DD0000">'bar'</font><font color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#FF8000">/*
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note 
that the message here is an array
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;*/ 
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">debug</font><font color="#007700">(array(</font><font 
color="#DD0000">'one'</font><font color="#007700">, </font><font 
color="#DD0000">'two'</font><font color="#007700">, </font><font 
color="#DD0000">'tree'</font><font color="#007700">));
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">info</font><font color="#007700">(</font><font 
color="#DD0000">'this is an INFO log generated by Bar() function'</font><font 
color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">warn</font><font color="#007700">(</font><font 
color="#DD0000">'this is a WARN log generated by Bar() function'</font><font 
color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">error</font><font color="#007700">(</font><font 
color="#DD0000">'this is an ERROR log generated by Bar() function'</font><font 
color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font 
color="#0000BB">$logger</font><font color="#007700">-&gt;</font><font 
color="#0000BB">fatal</font><font color="#007700">(</font><font 
color="#DD0000">'this is a FATAL log generated by Bar() function'</font><font 
color="#007700">);
-                    <br />&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />}
-                    <br />
-                    <br /></font><font color="#0000BB">$logger </font><font 
color="#007700">=&amp; </font><font color="#0000BB">LoggerManager</font><font 
color="#007700">::</font><font color="#0000BB">getLogger</font><font 
color="#007700">(</font><font color="#DD0000">'main'</font><font 
color="#007700">);
-                    <br />
-                    <br /></font><font color="#0000BB">$logger</font><font 
color="#007700">-&gt;</font><font color="#0000BB">debug</font><font 
color="#007700">(</font><font color="#DD0000">'this is a DEBUG log generated by 
main() function'</font><font color="#007700">);
-                    <br /></font><font color="#0000BB">$logger</font><font 
color="#007700">-&gt;</font><font color="#0000BB">info</font><font 
color="#007700">(</font><font color="#DD0000">'this is an INFO log generated by 
main() function'</font><font color="#007700">);
-                    <br /></font><font color="#0000BB">$logger</font><font 
color="#007700">-&gt;</font><font color="#0000BB">warn</font><font 
color="#007700">(</font><font color="#DD0000">'this is a WARN log generated by 
main() function'</font><font color="#007700">);
-                    <br /></font><font color="#0000BB">$logger</font><font 
color="#007700">-&gt;</font><font color="#0000BB">error</font><font 
color="#007700">(</font><font color="#DD0000">'this is an ERROR log generated 
by main() function'</font><font color="#007700">);
-                    <br /></font><font color="#0000BB">$logger</font><font 
color="#007700">-&gt;</font><font color="#0000BB">fatal</font><font 
color="#007700">(</font><font color="#DD0000">'this is a FATAL log generated by 
main() function'</font><font 
color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <br />
-                    <br />
-                    <br /></font><font color="#0000BB">$test </font><font 
color="#007700">= new </font><font color="#0000BB">Test</font><font 
color="#007700">();
-                    <br /></font><font color="#0000BB">$test</font><font 
color="#007700">-&gt;</font><font color="#0000BB">testLog</font><font 
color="#007700">();
-                    <br />
-                    <br /></font><font color="#0000BB">$testTest </font><font 
color="#007700">= new </font><font color="#0000BB">TestTest</font><font 
color="#007700">();
-                    <br /></font><font color="#0000BB">$testTest</font><font 
color="#007700">-&gt;</font><font color="#0000BB">testLog</font><font 
color="#007700">();
-                    <br />
-                    <br /></font><font color="#0000BB">Bar</font><font 
color="#007700">();
-                    <br />
-                    <br /></font><font color="#0000BB">?&gt;</font>
-                    </font>]]>
-            </code>
-        </section>            
-    </body>
-</document>
+Apache Log4php Usage Example">
+
++--
+<?php 
+/**
+ * This is a log4php usage example file
+ *
+ */
+
+/**
+ * Set LOG4PHP_DIR to Your log4php root dir or it will
+ * be set automatically at the first require_once().
+ * Here 'log4php' is an 'include_path' subdir.
+ */
+define('LOG4PHP_DIR', 'log4php');
+
+/*
+    1.  If you want to use a custom Configurator,
+        set the LOG4PHP_CONFIGURATOR_CLASS constants to Your Configurator 
class file.
+        The class name must have the same base name of the classfile.
+
+         Ex: define('LOG4PHP_CONFIGURATOR_CLASS', 
'/my/path/LoggerMyConfigurator');
+
+          Log4php will try to include '/my/path/LoggerMyConfigurator.php'
+          and instantiate a 'LoggerMyConfigurator' class.
+
+    2.  If you want to use a configuration file that's not the default,
+        set the LOG4PHP_CONFIGURATION constants to Your configuration filename.
+
+        Ex: define('LOG4PHP_CONFIGURATION', '/my/path/my_config.conf');
+
+        Note that if config extension is NOT .xml and 
LOG4PHP_CONFIGURATOR_CLASS
+        is not defined, the LoggerPropertyConfigurator will be used.
+
+    3.  If you want to bypass the initial configuration procedure, set the 
+        'LOG4PHP_DEFAULT_INIT_OVERRIDE' to true.
+
+         Ex: define('LOG4PHP_DEFAULT_INIT_OVERRIDE', true);
+*/
+
+require_once(LOG4PHP_DIR. '/LoggerManager.php');
+/* 
+    Or You can use:
+
+    require_once('/my/log4php/path/LoggerManager.php');
+
+    and LOG4PHP_DIR will be automatically set to '/my/log4php/path'.
+*/
+
+class Test {
+
+    var $logger;
+
+    function Test()
+    {
+        $this->logger =& LoggerManager::getLogger('Test');
+    }
+
+    function testLog()
+    {
+        $this->logger->debug('this is a DEBUG log generated by Test::testLog() 
class');
+        $this->logger->info('this is an INFO log generated by Test::testLog() 
class');
+        $this->logger->warn('this is a WARN log generated by Test::testLog() 
class');
+        $this->logger->error('this is an ERROR log generated by 
Test::testLog() class');
+        $this->logger->fatal('this is a FATAL log generated by Test::testLog() 
class');
+     }
+}
+
+class TestTest extends Test {
+    var $logger;
+
+    function TestTest()
+    {
+        $this->Test();
+        $this->logger =& LoggerManager::getLogger('Test.Test');
+    }
+
+    function testLog()
+    {
+        LoggerNDC::push('NDC generated by TestTest::testLog()');
+
+        $this->logger->debug('this is a DEBUG log generated by 
TestTest::testLog() class');
+        $this->logger->info('this is an INFO log generated by 
TestTest::testLog() class');
+        $this->logger->warn('this is a WARN log generated by 
TestTest::testLog() class');
+        $this>->logger->error('this is an ERROR log generated by 
TestTest::testLog() class');
+        $this->logger->fatal('this is a FATAL log generated by 
TestTest::testLog() class');
+
+        LoggerNDC::pop();
+    }
+} 
+
+function Bar()
+{
+    $logger =& LoggerManager::getLogger('bar');
+
+    /* 
+    note that the message here is an array
+    */ 
+    
+    $logger->debug(array('one', 'two', 'tree'));
+    $logger->info('this is an INFO log generated by Bar() function');
+    $logger->warn('this is a WARN log generated by Bar() function');
+    $logger->error('this is an ERROR log generated by Bar() function');
+    $logger->fatal('this is a FATAL log generated by Bar() function');
+}
+
+$logger =& LoggerManager::getLogger('main');
+$logger->debug('this is a DEBUG log generated by main() function');
+$logger->info('this is an INFO log generated by main() function');
+$logger->warn('this is a WARN log generated by main() function');
+$logger->error('this is an ERROR log generated by main() function');
+$logger->fatal('this is a FATAL log generated by main() function')
+
+$test = new Test();
+$test->testLog();
+
+$testTest = new TestTest();
+$testTest->testLog();
+
+Bar();
+?>
++--


Reply via email to