Fluent log engine Plugin for CakePHP
- PHP5
- CakePHP2
You can install it using the Composer.
{
"require": {
"nanapi/cakephp-fluent-logger": "v1.0.1"
}
}
cd app/Plugin
git clone [email protected]:nanapi/cakephp-fluent-logger.git FluentLogger
cd app/Vendor
git clone https://github.com/fluent/fluent-logger-php.git fluent/logger
Set the FluentLogger in bootstrap.
app/Config/bootstrap.php
<?php
CakePlugin::load('FluentLogger');
CakeLog::config('debug', array(
'engine' => 'FluentLogger.Fluent',
'types' => array('notice', 'info', 'debug'),
'prefix' => 'app',
'port' => 24224,
'host' => '127.0.0.1',
));
CakeLog::config('error', array(
'engine' => 'FluentLogger.Fluent',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'prefix' => 'app',
'port' => 24224,
'host' => '127.0.0.1',
));
your app
<?php
CakeLog::debug($param);