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 ma...@apache.org on 2004/03/08 22:09:43 UTC
cvs commit: logging-log4php/src/xdocs/stylesheets project.xml
marco 2004/03/08 13:09:43
Added: src/xdocs contributors.xml documentation.xml download.xml
index.xml news.xml projectStatus.xml qsg.xml
usage.xml
src/xdocs/stylesheets project.xml
Log:
Initial Import
Revision Changes Path
1.1 logging-log4php/src/xdocs/contributors.xml
Index: contributors.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Log4php - Contributors</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="Contributors">
<p>
Here is a list (in alphabetical order) of the developers that
(directly or indirectly) contributed to enhance the project.
Thank You all!
</p>
<ul>
<li>
<b>Abel Gonzalez</b>
<p>Abel is the author of the <i>LoggerAppenderDailyFile</i> appender.</p>
</li>
<li>
<b>Ilker Kiris</b>
<p>Bugs hunting, hints and modifications.</p>
</li>
<li>
<b>Domenico Lordi</b>
<p>Developer of the <i>LoggerAppenderMailEvent</i> appender.</p>
</li>
<li>
<b>Sergio Strampelli</b>
<p>An endless source of ideas, contribs and bugs hunting. Thank You guy!</p>
</li>
<li>
<b><a href="mailto:marco at apache dot org">Marco Vassura</a></b>
<p>The founder of the project and source code maintainer.</p>
</li>
<li>
<b>Blake Watters</b>
<p>Blake is the author of the <i>LoggerAppenderAdodb</i> appender.</p>
</li>
<li>
<b>Simon Wiest</b>
<p>Bugs hunting, hints.</p>
</li>
</ul>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/documentation.xml
Index: documentation.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Log4php - Documentation and Usage</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="Documentation and Usage">
<p>
<ul>
<li>The original <a href="http://logging.apache.org/log4j/docs">Log4j</a> documentation.</li>
<li>Quick setup <a href="qsg.html">guide</a>.</li>
<li>An usage <a href="usage.html">example</a>.</li>
<li>Browse the online <a href="api/index.html">api documentation</a>.</li>
</ul>
</p>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/download.xml
Index: download.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Log4php - Download</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="Download">
<subsection name="Requirements">
<p>
<ul>
<li>PHP >= 4.2.x (to log caller location information PHP >= 3.2.0 is needed).</li>
</ul>
</p>
</subsection>
<subsection name="Download Link">
<p>Download packages <a href="http://www.vxr.it/download.html">here</a>.</p>
</subsection>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Welcome to Log4php!</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="Introduction">
<p>Log4php is a php port of Log4j, the most popular Java logging framework
(see <a href="http://logging.apache.org/log4j/docs">Log4j</a> for details).</p>
<p>
Log4php supports:
<ul>
<li>Configuration through xml and properties file (same structure as log4j).</li>
<li>File, RollingFile, DailyFile, Echo, Console, Mail, PEAR::Db, PHP error,
Syslog or NT events and Socket appenders.</li>
<li>Simple, TTCC, Pattern, Html and Xml Layouts.</li>
<li>Nested (NDC) and Mapped (MDC) Diagnostic Contexts.</li>
<li>Switchable internal debug.</li>
</ul>
</p>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/news.xml
Index: news.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Welcome to Log4php!</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="News">
<h3>
7th of March 2004 - Log4php project has moved from
<a href="http://www.vxr.it/log4php">www.vxr.it/log4php</a>
to Apache Logging Services.</h3>
<p>
Log4php project has started the incubation phase in order to become
an apache project. The license has changed from LGPL to ASL 2.0.
</p>
<hr noshade="noshade" size="1"/>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/projectStatus.xml
Index: projectStatus.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Log4php - Project status</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="Project Status">
<p>
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.
</p>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/qsg.xml
Index: qsg.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author email="marco at apache dot org">Marco Vassura</author>
<title>Log4php - Quick Setup Guide</title>
</properties>
<meta name="keywords" content="php, java, logging, tracing, component, framework, API, log4php"/>
<body>
<section name="Quick Setup Guide">
<subsection name="The package tree">
<p>After unpacking the distribution file the following source tree will be created:</p>
<pre>
log4php-{version}
+---docs
| +---api
| qsg.html (this file)
| ...
\---src
+---log4php
| +---appenders
| +---config
| +---helpers
| +---layouts
| +---or
| +---spi
| +---varia
| \---xml
\---tests
...
</pre>
</subsection>
<subsection name="Installation">
<p>
Copy the "<code>log4php-{version}/src/log4php</code>" directory in a place accessible by PHP
(called in this document <code>{LOG4PHP-ROOT}</code>)
and that's all! Log4php is installed.
Optionally the <a href="api/log4php/_log4php_LoggerManager_php.html#defineLOG4PHP_DIR">LOG4PHP_DIR</a>
constant can be defined to point to <code>{LOG4PHP-ROOT}</code>.
</p>
</subsection>
<subsection name="How to use">
<p>
Three steps are required to use log4php:
</p>
<ol>
<li>
Create a configuration file (can be an ".ini"-type or xml file)
that will configure the log4php loggers hierarchy tree.<br/>
See the <code>tests/*/configs</code> directories for examples.<br/>
See <code>log4php.dtd</code> for xml elements reference.<br/>
Finally, take a look at the original log4j manual for more examples.
</li>
<li>
(Optional) Define the <a href="api/log4php/_log4php_LoggerManager_php.html#defineLOG4PHP_CONFIGURATION"><code>LOG4PHP_CONFIGURATION</code></a>
constant to point to the configuration above.
</li>
<li>
(Optional) Define the <a href="api/log4php/_log4php_LoggerManager_php.html#defineLOG4PHP_CONFIGURATOR_CLASS"><code>LOG4PHP_CONFIGURATOR_CLASS</code></a>
constant to point to a configuration class file.
</li>
<li>
Include the '<a href="api/log4php/LoggerManager.html"><code>LoggerManager.php</code></a>'
class file in your php scripts.
</li>
</ol>
<p>
Once the '<a href="api/log4php/LoggerManager.html">LoggerManager</a>' is included,
it will start the <a href="api/log4php/_log4php_LoggerManager_php.html#functionLoggerManagerDefaultInit">default init procedure</a>
that can be paramaterized by the previuosly defined
<a href="api/log4php/_log4php_LoggerManager_php.html#defineLOG4PHP_DEFAULT_INIT_OVERRIDE"><code>LOG4PHP_DEFAULT_INIT_OVERRIDE</code></a>,
<a href="api/log4php/_log4php_LoggerManager_php.html#defineLOG4PHP_CONFIGURATION"><code>LOG4PHP_CONFIGURATION</code></a> and
<a href="api/log4php/_log4php_LoggerManager_php.html#defineLOG4PHP_CONFIGURATOR_CLASS"><code>LOG4PHP_CONFIGURATOR_CLASS</code></a>
constants.
</p>
<p>Here is how to use <code>log4php</code> in user PHP code:</p>
<pre>
<?php
/*
Set LOG4PHP_* constants here
*/
require_once(LOG4PHP_DIR . '/LoggerManager.php');
/*
In a class
*/
class Log4phpTest {
/*
Your public and private vars
*/
var $_logger;
function Log4phpTest()
{
$this->_logger =& LoggerManager::getLogger('Log4phpTest');
$this->_logger->debug('Hello!');
}
}
function Log4phpTestFunction()
{
$logger =& LoggerManager::getLogger('Log4phpTestFunction');
$logger->debug('Hello again!');
}
/*
Your PHP code
*/
//Safely close all appenders with...
LoggerManager::shutdown();
?>
</pre>
</subsection>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/usage.xml
Index: usage.xml
===================================================================
<?xml version="1.0"?>
<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"><?php
<br />
<br /></font><font color="#FF8000">/**
<br /> * This is a log4php usage example file
<br /> *
<br /> * @version $Revision: 1.1 $
<br /> * @author Marco V. <marco@apache.org>
<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 /> 1. If you want to use a custom Configurator,
<br /> set the LOG4PHP_CONFIGURATOR_CLASS constants to Your Configurator class file.
<br /> The class name must have the same base name of the classfile.
<br />
<br /> Ex: define('LOG4PHP_CONFIGURATOR_CLASS', '/my/path/LoggerMyConfigurator');
<br />
<br /> Log4php will try to include '/my/path/LoggerMyConfigurator.php'
<br /> and instantiate a 'LoggerMyConfigurator' class.
<br />
<br /> 2. If you want to use a configuration file that's not the default,
<br /> set the LOG4PHP_CONFIGURATION constants to Your configuration filename.
<br />
<br /> Ex: define('LOG4PHP_CONFIGURATION', '/my/path/my_config.conf');
<br />
<br /> Note that if config extension is NOT .xml and LOG4PHP_CONFIGURATOR_CLASS
<br /> is not defined, the LoggerPropertyConfigurator will be used.
<br />
<br /> 3. If you want to bypass the initial configuration procedure, set the
<br /> 'LOG4PHP_DEFAULT_INIT_OVERRIDE' to true.
<br />
<br /> 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 /> Or You can use:
<br />
<br /> require_once('/my/log4php/path/LoggerManager.php');
<br />
<br /> 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 /> var </font><font color="#0000BB">$logger</font><font color="#007700">;
<br />
<br /> function </font><font color="#0000BB">Test</font><font color="#007700">()
<br /> {
<br /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger </font><font color="#007700">=& </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 /> }
<br />
<br /> function </font><font color="#0000BB">testLog</font><font color="#007700">()
<br /> {
<br /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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">);
<br /> }
<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 /> var </font><font color="#0000BB">$logger</font><font color="#007700">;
<br />
<br /> function </font><font color="#0000BB">TestTest</font><font color="#007700">()
<br /> {
<br /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">Test</font><font color="#007700">();
<br /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger </font><font color="#007700">=& </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 /> }
<br />
<br /> function </font><font color="#0000BB">testLog</font><font color="#007700">()
<br /> {
<br /> </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 />
<br /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$this</font><font color="#007700">-></font><font color="#0000BB">logger</font><font color="#007700">-></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 />
<br /> </font><font color="#0000BB">LoggerNDC</font><font color="#007700">::</font><font color="#0000BB">pop</font><font color="#007700">();
<br /> }
<br />
<br />}
<br />
<br />function </font><font color="#0000BB">Bar</font><font color="#007700">()
<br />{
<br /> </font><font color="#0000BB">$logger </font><font color="#007700">=& </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 /> </font><font color="#FF8000">/*
<br /> note that the message here is an array
<br /> */
<br /> </font><font color="#0000BB">$logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$logger</font><font color="#007700">-></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 /> </font><font color="#0000BB">$logger</font><font color="#007700">-></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 />
<br />}
<br />
<br /></font><font color="#0000BB">$logger </font><font color="#007700">=& </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">-></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">-></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">-></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">-></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">-></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">);
<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">-></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">-></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">?></font>
</font>]]>
</code>
</section>
</body>
</document>
1.1 logging-log4php/src/xdocs/stylesheets/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="Log4php" href="http://logging.apache.org/log4php/">
<title>Log4php project</title>
<body>
<menu name="Log4php Project">
<item name="News" href="/news.html"/>
<item name="Introduction" href="/index.html"/>
<item name="Project status" href="/projectStatus.html"/>
<item name="Download" href="/download.html"/>
<item name="Documentation" href="/documentation.html"/>
<item name="Contributors" href="/contributors.html"/>
</menu>
<menu name="Logging Services">
<item name="Home page" href="http://logging.apache.org/"/>
<item name="News" href="http://logging.apache.org/site/news.html"/>
<item name="Mission" href="http://logging.apache.org/site/mission-statement.html"/>
<item name="Guidelines" href="http://logging.apache.org/site/bylaws.html"/>
</menu>
</body>
</project>