source: branches/comu-ver2/data/module/log4php/php4/log4php/LoggerBasicConfigurator.php @ 18220

Revision 18220, 2.4 KB checked in by yokkuns, 15 years ago (diff)

#149 ロガークラス作成

Line 
1<?php
2/**
3 * log4php is a PHP port of the log4j java logging package.
4 *
5 * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
6 * <p>Design, strategies and part of the methods documentation are developed by log4j team
7 * (Ceki Gülcü as log4j project founder and
8 * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
9 *
10 * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
11 * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
12 *
13 * <p>This software is published under the terms of the LGPL License
14 * a copy of which has been included with this distribution in the LICENSE file.</p>
15 *
16 * @package log4php
17 */
18
19/**
20 * @ignore
21 */
22if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
23
24require_once(LOG4PHP_DIR . '/spi/LoggerConfigurator.php');
25require_once(LOG4PHP_DIR . '/LoggerLayout.php');
26require_once(LOG4PHP_DIR . '/LoggerAppender.php');
27require_once(LOG4PHP_DIR . '/LoggerManager.php');
28
29/**
30 * Use this class to quickly configure the package.
31 *
32 * <p>For file based configuration see {@link LoggerPropertyConfigurator}.
33 * <p>For XML based configuration see {@link LoggerDOMConfigurator}.
34 *
35 * @author VxR <vxr@vxr.it>
36 * @version $Revision: 1.2 $
37 * @package log4php
38 * @since 0.5
39 */
40class LoggerBasicConfigurator extends LoggerConfigurator {
41
42    function LoggerBasicConfigurator()
43    {
44        return;
45    }
46
47    /**
48     * Add a {@link LoggerAppenderConsole} that uses
49     * the {@link LoggerLayoutTTCC} to the root category.
50     *
51     * @param string $url not used here
52     * @static 
53     */
54    function configure($url = null)
55    {
56        $root =& LoggerManager::getRootLogger();
57       
58        $appender =& LoggerAppender::singleton('A1', 'LoggerAppenderConsole');
59        $layout = LoggerLayout::factory('LoggerLayoutTTCC');
60        $appender->setLayout($layout);
61
62        $root->addAppender($appender));
63    }
64
65    /**
66     * Reset the default hierarchy to its defaut.
67     * It is equivalent to
68     * <code>
69     * LoggerManager::resetConfiguration();
70     * </code>
71     *
72     * @see LoggerHierarchy::resetConfiguration()
73     * @static
74     */
75    function resetConfiguration()
76    {
77        LoggerManager::resetConfiguration();
78    }
79}
80?>
Note: See TracBrowser for help on using the repository browser.