mirko-pagliai / cakephp-entity-file-log
A log adapter that writes log (as entities) files
Installs: 9 483
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=7.2
- cakephp/cakephp: ^4.0
- mirko-pagliai/php-tools: ^1.4.4
Requires (Dev)
- cakephp/cakephp-codesniffer: ^4.0
- mirko-pagliai/me-tools: ^2.19.7
- phpunit/phpunit: ^8.5|^9.0
This package is auto-updated.
Last update: 2022-01-04 17:07:19 UTC
README
cakephp-entity-file-log is a CakePHP plugin that provides a log adapter that writes log (as entities) files.
Did you like this plugin? Its development requires a lot of time for me. Please consider the possibility of making a donation: even a coffee is enough! Thank you.
Installation
You can install the plugin via composer:
$ composer require --prefer-dist mirko-pagliai/cakephp-entity-file-log
Then you have to load the plugin. For more information on how to load the plugin, please refer to the Cookbook.
Simply, you can execute the shell command to enable the plugin:
bin/cake plugin load EntityFileLog
This would update your application's bootstrap method.
Installation on older CakePHP and PHP versions
Recent packages and the master branch require at least CakePHP 4.0 and PHP 7.2. Instead, the cakephp3 branch requires at least PHP 5.6.
In this case, you can install the package as well:
$ composer require --prefer-dist mirko-pagliai/cakephp-entity-file-log:dev-cakephp3
Note that the cakephp3
branch will no longer be updated as of April 29, 2021,
except for security patches, and it matches the
1.1.3 version.
How to use
Simply, you have to use the EntityFileLog\Log\Engine\EntityFileLog
class as a log adapter.
For more information on how to configure logs, please refer to the Cookbook.
Example:
Log::setConfig('error', [ 'className' => 'EntityFileLog\Log\Engine\EntityFileLog', 'path' => LOGS, 'file' => 'error', 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], ]);
Versioning
For transparency and insight into our release cycle and to maintain backward compatibility, cakephp-entity-file-log will be maintained under the Semantic Versioning guidelines.