YULLogger.class.php
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
require_once(dirname(__FILE__).'/../log4php/Logger.php');
class YULLogger
{
private static $dailyLogger = null;
private static $dbLogger = null;
public static function getDailyLogger()
{
if (!isset(self::$dailyLogger))
{
Logger::configure(dirname(__FILE__).'/config/appender_daily.properties');
self::$dailyLogger = Logger::getRootLogger();
}
// 20111014 dan: 删除此处var_dump
return self::$dailyLogger;
}
public static function getDBLogger()
{
if (!isset(self::$dbLogger))
{
Logger::configure(dirname(__FILE__).'/config/appender_pdo.properties');
self::$dbLogger = Logger::getRootLogger();
}
return self::$dbLogger;
}
public static function destroyDailyLogger()
{
if (isset(self::$dailyLogger))
{
try
{
self::$dailyLogger->shutdown();
} catch (Exception $e)
{
// TODO
}
}
}
public static function destroyDBLogger()
{
if (isset(self::$dbLogger))
{
try
{
self::$dbLogger->shutdown();
} catch (Exception $e)
{
// TODO
}
}
}
}
?>