本文概述
- 适配器
- 创建日志
适配器【Phalcon日志】适配器用于存储记录的消息。支持的适配器列表:
Adapters | Description |
---|---|
Phalcon\Logger\Adapter\File | 记录到纯文本文件 |
Phalcon\Logger\Adapter\Stream | 记录到PHP流 |
Phalcon\Logger\Adapter\Syslog | 记录到系统记录器 |
Phalcon\Logger\Adapter\FirePHP | 登录到FirePHP |
<
?phpuse Phalcon\Logger;
use Phalcon\Logger\Adapter\File as FileAdapter;
$logger = new FileAdapter('app/logs/test.log');
// These are the different log levels available:$logger->
critical(
'This is a critical message'
);
$logger->
emergency(
'This is an emergency message'
);
$logger->
debug(
'This is a debug message'
);
$logger->
error(
'This is an error message'
);
$logger->
info(
'This is an info message'
);
?>
推荐阅读
- Phalcon国际化
- Phalcon模型层
- Phalcon图片
- Phalcon数据库操作(插入/更新/删除行)
- Phalcon第一个例子
- Phalcon表单用法例子
- Phalcon Cookie管理
- 跨站请求伪造(CSRF)保护
- Phalcon连接到数据库