mirko-pagliai/cakephp-entity-file-log

This package is abandoned and no longer maintained. No replacement package was suggested.

A log adapter that writes log (as entities) files

1.1.4 2021-10-06 12:43 UTC

This package is auto-updated.

Last update: 2022-01-04 17:07:19 UTC


README

Software License CI codecov Codacy Badge CodeFactor

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.

Make a donation

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.