Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Log writer for ZF2 Zend\Log

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 Module.php
Octocat-spinner-32 README.md
Octocat-spinner-32 autoload_classmap.php
Octocat-spinner-32 autoload_function.php
Octocat-spinner-32 autoload_register.php
README.md

ChromePhp writer for Zend\Log

This module provides an adapter to use ChromePhp in the Zend Framework 2 as writer for Zend\Log. The module provides also a formatter to map the Zend\Log priorities to the so-called severities of ChromePhp.

Installation

It is the easiest way to add this module as submodule to your ZF2.0 project, if you use git yourself. Then, the only thing you need is

cd to/your/project
git submodule add --recursive git://github.com/juriansluiman/ChromePhpLogger.git modules/vendor/ChromePhpLogger

Then, open your configs/application.config.php and add the module ChromePhpLogger to your modules configuration.

If you don't use git for your own project, clone the repository, add the folder to your modules path.

cd path/to/storage
git clone --recursive git://github.com/juriansluiman/ChromePhpLogger.git

Add the path/to/storage to your modules path and include the module in your application.config.php.

Usage

To use this writer for Zend\Log, you can do something like this:

use Zend\Log\Logger,
    ChromePhpLogger\Log\Writer\ChromePhp as Writer;

$log = Logger::factory(array(
    new Writer
));

Then you can log to ChromePhp:

// Assume $log is instantiated as above
$log->log('Hello World!', Logger::INFO);

DI

You should be able to set up the configuration with DI as well. This is not documentated, will be online soon.

Something went wrong with that request. Please try again.