文件形式

文件形式日志类
属性
命名空间 fize\log\handler
类名 File
父类 fize\log\AbstractLog
实现接口 fize\log\LogHandler, Psr\Log\LoggerInterface
方法:
方法名 说明
__construct() 构造函数
log() 可任意级别记录日志
emergency() System is unusable.
alert() Action must be taken immediately.
critical() Critical conditions.

|critical() |Critical conditions. | +—————–+————————————————————————————————–+ |error() |Runtime errors that do not require immediate action but should typically be logged and monitored. | +—————–+————————————————————————————————–+ |warning() |Exceptional occurrences that are not errors. | +—————–+————————————————————————————————–+ |notice() |Normal but significant events. | +—————–+————————————————————————————————–+ |info() |Interesting events. | +—————–+————————————————————————————————–+ |debug() |Detailed debug information. | +—————–+————————————————————————————————–+

方法

__construct()

构造函数

public function __construct (
    array $config = []
)
参数:
名称 说明
config 参数

log()

可任意级别记录日志

public function log (
    string $level,
    string $message,
    array $context = []
)
参数:
名称 说明
level 日志级别
message 日志内容
context 占位符内容

emergency()

System is unusable.

public function emergency (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

alert()

Action must be taken immediately.

public function alert (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.

critical()

Critical conditions.

public function critical (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: Application component unavailable, unexpected exception.

error()

Runtime errors that do not require immediate action but should typically be logged and monitored.

public function error (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

warning()

Exceptional occurrences that are not errors.

public function warning (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.

notice()

Normal but significant events.

public function notice (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

info()

Interesting events.

public function info (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: User logs in, SQL logs.

debug()

Detailed debug information.

public function debug (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context