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 | */
|
---|
22 | if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
|
---|
23 |
|
---|
24 | require_once(LOG4PHP_DIR . '/spi/LoggerConfigurator.php');
|
---|
25 | require_once(LOG4PHP_DIR . '/LoggerLayout.php');
|
---|
26 | require_once(LOG4PHP_DIR . '/LoggerAppender.php');
|
---|
27 | require_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 | */
|
---|
40 | class 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 | ?> |
---|