Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fusic/accesslogs
get access logs of "controller name", "action name", "params", "auth.user_id", "client_ip"
https://github.com/fusic/accesslogs
Last synced: about 1 month ago
JSON representation
get access logs of "controller name", "action name", "params", "auth.user_id", "client_ip"
- Host: GitHub
- URL: https://github.com/fusic/accesslogs
- Owner: fusic
- Created: 2016-12-11T06:40:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T01:25:00.000Z (over 7 years ago)
- Last Synced: 2024-04-27T03:03:09.920Z (8 months ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AccessLogs plugin for CakePHP
maintainer: @gorogoroyasu## Installation
```
composer require fusic/accesslogs
```# settings
in controller which you want to save logs,
```
$this->loadComponent('AccessLogs.AccessLogs');//in case you dont want to save some specific data,
// you have to modify how to load the component like shown below.
// (like, password, credit cart, etc...)$this->loadComponent('AccessLogs.AccessLogs', ['blacklist' => ['password']]);
```
next, you have to exec the migration.
please copy the code below, and exec it!
```
table('access_logs');
$table->addColumn('user_id', 'integer', ['null' => true])
->addColumn('controller', 'string', ['null' => true, 'limit' => 255])
->addColumn('action', 'string', ['null' => true, 'limit' => 255])
->addColumn('passes', 'string', ['null' => true, 'limit' => 255])
->addColumn('client_ip', 'string', ['null' => true, 'limit' => 255])
->addColumn('url', 'string', ['null' => true])
->addColumn('code', 'string', ['null' => true, 'limit' => 255])
->addColumn('query', 'text', ['null' => true])
->addColumn('data', 'text', ['null' => true])
->addColumn('created', 'timestamp', ['null' => false])
->addIndex('user_id')
->addIndex('controller')
->addIndex('action')
->addIndex('passes')
->addIndex('client_ip')
->addIndex('code')
->create();
}
}
```