marco 2004/03/08 13:21:12
Added: src/tests/appenders/configs LoggerAppenderConsole.xml
LoggerAppenderDailyFile.xml LoggerAppenderDb.xml
LoggerAppenderEcho.xml LoggerAppenderFile.xml
LoggerAppenderMail.xml LoggerAppenderMailEvent.xml
LoggerAppenderNull.xml
LoggerAppenderNullThreshold.xml
LoggerAppenderPhp.xml LoggerAppenderRollingFile.xml
LoggerAppenderSocket.xml
LoggerAppenderSocketLog4j.xml
LoggerAppenderSyslog.xml
src/tests/appenders test.php
Log:
Initial Import
Revision Changes Path
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderConsole.xml
Index: LoggerAppenderConsole.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="console" class="LoggerAppenderConsole">
<!--
<param name="target" value="STDERR" />
-->
<layout class="LoggerLayoutSimple" />
</appender>
<root>
<level value="all" />
<appender_ref ref="console" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderDailyFile.xml
Index: LoggerAppenderDailyFile.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
</layout>
</appender>
<appender name="daily01" class="LoggerAppenderDailyFile">
<param name="datePattern" value="Ymd" />
<param name="file" value="${TMP}/test_LoggerAppenderDailyFile_%s.txt"
/>
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
</layout>
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="daily01" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderDb.xml
Index: LoggerAppenderDb.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderDb">
<param name="dsn" value="mysql://localhost/test" />
<param name="createTable" value="true" />
<param name="table" value="log4php" />
<param name="sql" value="INSERT INTO log4php (timestamp, logger,
level, message, thread, file, line) VALUES
('%d','%c','%p','%m','%t','%F','%L')" />
</appender>
<root>
<level value="all" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderEcho.xml
Index: LoggerAppenderEcho.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutHtml">
<param name="locationInfo" value="true" />
<param name="title" value="LoggerAppenderEcho Test" />
</layout>
</appender>
<root>
<level value="all" />
<appender_ref ref="default" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderFile.xml
Index: LoggerAppenderFile.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="true">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
<param name="dateFormat" value="[%c]" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderFile">
<param name="file" value="${TMP}/test_LoggerAppenderFile.xml" />
<param name="append" value="false" />
<layout class="LoggerXmlLayout">
<param name="locationInfo" value="true" />
</layout>
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderMail.xml
Index: LoggerAppenderMail.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderMail">
<param name="from" value="[EMAIL PROTECTED]" />
<param name="to" value="[EMAIL PROTECTED]" />
<param name="subject" value="Log4php test" />
<layout class="LoggerLayoutTTCC" />
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderMailEvent.xml
Index: LoggerAppenderMailEvent.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderMailEvent">
<param name="from" value="[EMAIL PROTECTED]" />
<param name="to" value="[EMAIL PROTECTED]" />
<param name="subject" value="Log4php test" />
<layout class="LoggerLayoutTTCC" />
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderNull.xml
Index: LoggerAppenderNull.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="true">
<appender name="test" class="LoggerAppenderNull" />
<root>
<level value="debug" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderNullThreshold.xml
Index: LoggerAppenderNullThreshold.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.8
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="true">
<appender name="default" class="LoggerAppenderEcho">
<param name="threshold" value="warn" />
<layout class="LoggerLayoutHtml" />
</appender>
<appender name="test" class="LoggerAppenderNull">
<param name="threshold" value="warn" />
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderPhp.xml
Index: LoggerAppenderPhp.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
<param name="dateFormat" value="[%c]" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderPhp" />
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderRollingFile.xml
Index: LoggerAppenderRollingFile.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
<param name="dateFormat" value="[%c]" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderRollingFile">
<!-- win32 example -->
<param name="file" value="${TMP}/test_LoggerAppenderRollingFile.txt"
/>
<param name="maxFileSize" value="10KB" />
<param name="maxBackupIndex" value="3" />
<layout class="LoggerLayoutTTCC" />
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderSocket.xml
Index: LoggerAppenderSocket.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerXmlLayout">
<param name="locationInfo" value="true" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderSocket">
<param name="remoteHost" value="tcp://127.0.0.1" />
<param name="port" value="4446" />
<param name="useXml" value="true" />
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderSocketLog4j.xml
Index: LoggerAppenderSocketLog4j.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.7
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerXmlLayout">
<param name="locationInfo" value="true" />
<param name="log4jNamespace" value="true" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderSocket">
<param name="remoteHost" value="tcp://127.0.0.1" />
<param name="port" value="2222" />
<param name="useXml" value="true" />
<param name="log4jNamespace" value="true" />
</appender>
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1
logging-log4php/src/tests/appenders/configs/LoggerAppenderSyslog.xml
Index: LoggerAppenderSyslog.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation.
This software is published under the terms of the Apache Software
License version 2.0, a copy of which has been included with this
distribution in the LICENSE file.
@author Marco V. <[EMAIL PROTECTED]>
@version $Revision: 1.1 $
@since 0.3
-->
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="all" debug="false">
<appender name="default" class="LoggerAppenderEcho">
<layout class="LoggerLayoutTTCC">
<param name="threadPrinting" value="true" />
<param name="categoryPrefixing" value="true" />
<param name="contextPrinting" value="true" />
<param name="microSecondsPrinting" value="true" />
</layout>
</appender>
<appender name="test" class="LoggerAppenderSyslog" />
<root>
<level value="debug" />
<appender_ref ref="default" />
<appender_ref ref="test" />
</root>
</log4php:configuration>
1.1 logging-log4php/src/tests/appenders/test.php
Index: test.php
===================================================================
<?php
/**
* Copyright 2004 The Apache Software Foundation.
*
* This software is published under the terms of the Apache Software
* License version 2.0, a copy of which has been included with this
* distribution in the LICENSE file.
*
* @package tests
* @author Marco V. <[EMAIL PROTECTED]>
* @subpackage appenders
* @version $Revision: 1.1 $
* @since 0.3
*/
/**
* @var array Test array
*/
$tests = array(
'LoggerAppenderConsole' => array(
'__COMMENT__' => 'Output to php://stderr. In web enviroment you wont
see anything'
),
'LoggerAppenderDailyFile' => array(
'__COMMENT__' => 'Echo + write a test_LoggerAppenderDailyFile_%s.txt
file to TMP env dir',
),
'LoggerAppenderDb' => array(
'__COMMENT__' => 'Echo + write to log4php table in
mysql://localhost/test. Tries to create the table.',
),
'LoggerAppenderEcho' => array(
'__COMMENT__' => 'Echo with Html layout',
),
'LoggerAppenderFile' => array(
'__COMMENT__' => 'Echo + write a test_LoggerAppenderFile.xml file to
TMP env dir with Xml layout',
),
'LoggerAppenderMail' => array(
'__COMMENT__' => 'Echo + mail to [EMAIL PROTECTED]',
),
'LoggerAppenderMailEvent' => array(
'__COMMENT__' => 'Echo + (1 event = 1 mail) to [EMAIL PROTECTED]',
),
'LoggerAppenderNull' => array(
'__COMMENT__' => 'Writes to ... null (debug turned on)',
),
'LoggerAppenderNullThreshold' => array(
'__COMMENT__' => 'Writes to ... null (debug turned on) with
threshold',
),
'LoggerAppenderPhp' => array(
'__COMMENT__' => 'Writes with trigger_error(). Execution will stop
with an ERROR log.',
),
'LoggerAppenderRollingFile' => array(
'__COMMENT__' => 'Echo + write a test_LoggerAppenderRollingFile.txt
file to TMP env dir. 3 files max 10kB',
),
'LoggerAppenderSocket' => array(
'__COMMENT__' => 'Echo + send to tcp://127.0.0.1 port 4446',
'TEST_SEND_HTML' => false,
'CONTENT_TYPE' => 'application/xml',
'HTML_HEADER' => '<?xml version="1.0" encoding="ISO-8859-1"?>'
),
'LoggerAppenderSocketLog4j' => array(
'__COMMENT__' => 'Echo + send to tcp://127.0.0.1 port 2222 with log4j
namespace',
'TEST_SEND_HTML' => false,
'CONTENT_TYPE' => 'application/xml',
'HTML_HEADER' => '<?xml version="1.0" encoding="ISO-8859-1"?>'
),
'LoggerAppenderSyslog' => array(
'__COMMENT__' => 'Echo + send to syslog/NT events',
),
);
require_once('../test_core.php');
?>