Constants

LEVEL_LOG

LEVEL_LOG = 0

LEVEL_INFO

LEVEL_INFO = 1

LEVEL_DEBUG

LEVEL_DEBUG = 2

LEVEL_WARN

LEVEL_WARN = 3

LEVEL_ERROR

LEVEL_ERROR = 4

LEVEL_SQL

LEVEL_SQL = 5

LEVEL_TASK

LEVEL_TASK = 6

LEVEL_EVENT

LEVEL_EVENT = 7

LEVEL_CUSTOM

LEVEL_CUSTOM = 8

MAX_LOG_SIZE

MAX_LOG_SIZE = 5

SIZE_UNIT

SIZE_UNIT = 'MB'

LOG_END_ALL

LOG_END_ALL = '<<<==='

LOG_STA_FLAG

LOG_STA_FLAG = '===>>>'

Properties

$levelArr

$levelArr : 

Type

$max_size

$max_size : 

Type

$size

$size : 

Type

$size_unit

$size_unit : 

Type

$log_dir

$log_dir : 

Type

$template

$template : 

Type

$buffer

$buffer : 

Type

Methods

format()

format(  $data,   $level) : mixed

日志格式化 记录

Parameters

$data
$level

Returns

mixed

add()

add(  $data,   $level) : mixed

日志添加

Parameters

$data
$level

Returns

mixed

__construct()

__construct(array  $config = array()) 

文件 日志 FileLogger constructor.

Parameters

array $config

zip()

zip(null  $file = null, string  $zipFile = '', string  $exclusion = array('.', '..')) : boolean|integer

压缩 文件

Parameters

null $file

[ 文件或者文件名 或者正则 ]

string $zipFile

[ 压缩后的文件名 ]

string $exclusion

[ 排除 ]

Returns

boolean|integer

__destruct()

__destruct() 

析构 函数

__initFormConfig()

__initFormConfig(  $config = array()) 

Parameters

$config

file()

file() : boolean|string

写 文件路径

Returns

boolean|string

save()

save() : boolean|integer

持久化保存 日志

Returns

boolean|integer

cutSize()

cutSize(  $file = '') : string

分割 文件大小

Parameters

$file

Returns

string

compSize()

compSize(  $size) : boolean

计算 大小

Parameters

$size

Returns

boolean