nanapi/cakephp-fluent-logger

Fluent log engine plugin for CakePHP

Installs: 243

Dependents: 0

Stars: 6

Watches: 8

Forks: 2

Language: PHP

v1.0.1 2014-01-27 02:28 UTC

README

Fluent log engine Plugin for CakePHP

Requirements

  • PHP5
  • CakePHP2

Installation

You can install it using the Composer.

Using Composer

{
  "require": {
    "nanapi/cakephp-fluent-logger": "v1.0.1"
  }
}

copy directory

cd app/Plugin
git clone git@github.com:nanapi/cakephp-fluent-logger.git FluentLogger

cd app/Vendor
git clone https://github.com/fluent/fluent-logger-php.git fluent/logger

How to user it

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);