qingbing / yii2-access-log
yii2实现组件:接口访问日志
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/qingbing/yii2-access-log
Requires
- php: ^7.1.0
- ext-curl: *
- ext-json: *
- ext-openssl: *
- qingbing/yii2-helper: ^1.0
- qingbing/zf-helper: ^1.0
- yiisoft/yii2: ~2.0.14
- yiisoft/yii2-bootstrap: ~2.0.0
- yiisoft/yii2-httpclient: ^2.0
- yiisoft/yii2-queue: ^2.3
- yiisoft/yii2-redis: ^2.0
This package is auto-updated.
Last update: 2025-10-20 20:42:52 UTC
README
yii2实现组件:接口访问日志
使用
一、配置
1.1 配置控制器 web.php
'controllerMap' => [ // 请求访问日志 'access-log' => \YiiAccessLog\controllers\AccessLogController::class, ]
1.2 配置启动自动增加接口访问日志 web.php
'bootstrap' => [ 'bootAccessLog', ], 'components' => [ 'bootAccessLog' => [ 'class' => \YiiAccessLog\boots\AccessLogBootstrap::class, 'accessLogModel' => \YiiAccessLog\models\AccessLogs::class, // 日志模型类 'open' => define_var('COM_BOOT_ACCESS_LOG_OPEN', true), // 开启访问日志 'ignorePaths' => [ '*/list', // 列表的日志不记录,太大 ], ], ],
1.3 组件常量配置 define-local.php
// bootAccessLog 组件配置 defined('COM_BOOT_ACCESS_LOG_OPEN') or define('COM_BOOT_ACCESS_LOG_OPEN', true); // 开启访问日志