ChromePhp - a PHP library for the Chrome Logger Google Chrome extension

Last update: May 13, 2022

Overview

ChromePhp is a PHP library for the Chrome Logger Google Chrome extension.

This library allows you to log variables to the Chrome console.

Requirements

  • PHP 5 or later

Installation

  1. Install the Chrome extension from: https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd

  2. Click the extension icon in the browser to enable it for the current tab's domain

  3. Put ChromePhp.php somewhere in your PHP include path

  4. Log some data

    include 'ChromePhp.php';
    ChromePhp::log('Hello console!');
    ChromePhp::log($_SERVER);
    ChromePhp::warn('something went wrong!');

More information can be found here: http://www.chromelogger.com

GitHub

https://github.com/ccampbell/chromephp
Comments
  • 1. WordPress theme - headers already sent

    Using chromePHP inside a WordPress theme gives me an error of "headers already sent". The problematic line is 385:

    header(self::HEADER_NAME . ': ' . $this->_encode($data));

    Using ChromePHP in WP is no problem as long as wp_head() isn't called. Is there a known workaround?

    Reviewed by jancbeck at 2012-03-20 13:32
  • 2. Use self() instead of ChromePhp()

    To make the class easily renamed (which could be needed for certain autoloaders like it was for me) you have to make this little code edit. Should be self() anyway.

    Reviewed by robclancy at 2012-09-06 09:59
  • 3. Add Composer support

    Hey Craig!

    I decided to take up on your offer and write a composer.json file for your class! Please check the data and see if everything is OK (especially in the description and authors and such).

    Once you merged my changes, I'll submit the package here. Composer is a dependency manager for PHP, it allows you to manage libraries and packages on a per-project basis. If you still do work with PHP you should check it out. :)

    Reviewed by pcalves at 2013-01-21 17:31
  • 4. Auto include on every page

    In php.ini there is a config option called auto_prepend_file.

    http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

    If you set that option to something like

    auto_prepend_file = /var/www/ChromePhp.php
    

    Then the script will be automatically be included on every page. It's great for when you're working on a team project and not everyone is using the same environment as you. You don't have to commit ChromePhp to your version control system or leave include statements all over the place. It also just saves time in general.

    Perhaps you could add this information to the Readme? I'm sure a lot of people would benefit from this knowledge.

    Reviewed by beardedlinuxgeek at 2013-04-18 17:49
  • 5. Installation problem on latest Chrome

    Each time I try to install chromephp I get an error telling me 'Download was not a CRX'. When I try to install it manually I am told 'CRX_MAGIC_NUMBER_INVALID'. I get the crx from my Downloads directory. I am running Mountain Lion with Chrome version: 24.0.1312.56 Thanks

    Reviewed by rock-weld at 2013-01-30 01:03
  • 6. PHP Error: Recursion detected

    I always get this PHP error when using the script on my site...

    A PHP Error was encountered
    Severity: Warning
    Message: json_encode(): recursion detected
    Filename: libraries/ChromePhp.php
    Line Number: 396
    

    Is there a fix for this?

    Reviewed by bluetidepro at 2013-01-19 19:13
  • 7. how can i log after i already sent some data?

    I have a php script that streams real-time logs and does some operations based on those logs. Is it ok to log after the headers and part of body have already been sent?

    Reviewed by beppe9000 at 2017-03-13 12:29
  • 8. Example for ChromePhp::table()

    Could you add an example of how to use the table type? Not really understanding how to use it properly... like... what do I pass in there? πŸ€”

    Tried looking in the techspecs and in ChromePhp.php, but yeah... not feeling any wiser πŸ˜•

    Reviewed by Svish at 2017-03-08 02:48
  • 9. Warning: Cannot modify header information

    Warning: Cannot modify header information - headers already sent by (output started at /Volumes/Backup/Sites/test/chromelogger/index.php:1) in /Volumes/Backup/Sites/test/chromelogger/ChromePhp.php on line 394
    

    just put this

    <?php
       require 'ChromePhp.php';
       ChromePhp::log('Hello console!');
    ?>
    
    Reviewed by MarcoGomesr at 2013-11-23 15:25
  • 10. Setting to turn off backtraces

    We utilize ChromePHP through an abstraction layer that detects the browser before outputting messages. The problem is that the entry point is always the same from our code into the log method so the backtrace that's appended is useless. I'm hoping you can add an option to simply disable the backtrace functionality as we just add this ourselves.

    Reviewed by drakej at 2012-08-07 22:55
  • 11. Can I do this?

    Can i fork your project and turn this into a helper for codeigniter and release it as a spark?

    With your licence and copyright obviously.

    cheers, Marco

    Reviewed by mpmont at 2012-05-21 23:11
123Solar is a set of PHP/JS files that make a web logger to monitor your photovoltaic inverter(s)

123Solar is a set of PHP/JS files that make a web logger to monitor your photovoltaic inverter(s). It just need a web server and PHP, no databases are even needed. The philosophy is: To keep it simple, fast, with a low foot print to run on cheap and low powered devices.

May 5, 2022
Simple PHP Logger. Composer package

Basic PHP Logger ?? Simple logger. Composer package.

Jan 28, 2022
A simple database logger for all outgoing emails sent by Laravel website.

Laravel Email Database Log A simple database logger for all outgoing emails sent by Laravel website.

Apr 30, 2022
Test Doubles for the PSR-3 Logger Interface

PSR Log Test Doubles Test Doubles for the PSR-3 Logger Interface Motivation In PHP world, most people create Test Doubles via PHPUnits mocking framewo

May 20, 2022
temperature-pi: a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite database
temperature-pi: a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite database

temperature-pi temperature-pi is a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite da

Dec 27, 2020
πŸ“‘ Laravel HTTP Logger
πŸ“‘ Laravel HTTP Logger

Logging incoming HTTP requests

Apr 4, 2022
Allows you to process logs using any PSR-3 compatible logger such as Monolog

Yii 2 PSR Log Target Allows you to process logs using any PSR-3 compatible logger such as Monolog

Apr 8, 2022
An effective,fast,stable log extension for PHP
An effective,fast,stable log extension for PHP

SeasLog An effective,fast,stable log extension for PHP @author Chitao.Gao [[email protected]] Documentation On php.net δΈ­ζ–‡ζ–‡ζ‘£ Synopsis Why use seaslog What

Apr 18, 2022
PHP logging library that is highly extendable and simple to use.

Analog - Minimal PHP logging library Copyright: (c) 2012-Present Johnny Broadway License: MIT A minimal PHP logging package based on the idea of using

Apr 10, 2022
Amazon Web Services CloudWatch Logs Handler for Monolog library

AWS CloudWatch Logs Handler for Monolog Handler for PHP logging library Monolog for sending log entries to AWS CloudWatch Logs service. Before using t

May 24, 2022
A Simple Logging Class For PHP

KLogger: Simple Logging for PHP A project written by Kenny Katzgrau and Dan Horrigan. About KLogger is an easy-to-use PSR-3 compliant logging class fo

May 16, 2022
Laravel logger is an activity event logger for your Laravel or Lumen application
Laravel logger is an activity event logger for your Laravel or Lumen application

Laravel logger is an activity event logger for your Laravel or Lumen application. It comes out the box with ready to use with dashboard to view your activity. Laravel logger can be added as a middleware or called through a trait. Easily have an Activity Log. This package is easily configurable and customizable. Supports Laravel 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, and 7+

May 24, 2022
Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

PHP Console server library PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things u

May 19, 2022
Laravel 4.* and 5.* service providers to handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

Laravel 4.* service provider for PHP Console See https://github.com/barbushin/php-console-laravel/releases/tag/1.2.1 Use "php-console/laravel-service-

Mar 3, 2021
Chrome extension to generate Laravel integration tests while using your app.

Laravel TestTools Check out the introduction post about the chrome extension. Installation git clone [email protected]:mpociot/laravel-testtools.git # i

May 12, 2022
Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

May 26, 2022
Instrument headless chrome/chromium instances from PHP

Chrome PHP This library lets you start playing with chrome/chromium in headless mode from PHP. Can be used synchronously and asynchronously! Features

May 18, 2022
Control Chrome or Chromium easily.

Laravel Chromedriver Control Chrome or Chromium easily. Requirements PHP 7.4 or latest Laravel 8.x Chrome or Chromium latest version Installation You

Sep 10, 2021
Magento Chrome Toolbar for MSP_DevTools
Magento Chrome Toolbar for MSP_DevTools

Magento Chrome Toolbar for MSP DevTools Magento Chrome Toolbar is a chrome extension to be used with MSP_DevTools for Magento 1 or Magento 2. This ext

May 17, 2022
BroRelo - Browser Auto Refresh / Reload for Firefox, Chrome & Opera

BroRelo - Browser Auto Refresh / Reload for Firefox, Chrome & Opera Ubuntu 21.10 | Apache/2.4.48 | PHP 8.0.18 This package can reload windows regardle

May 5, 2022