I have been working for server and client side scripting, whenever I got the issue in JavaScript used to debug in console or fire-bug based on the browser and extension.
But it’s not possible in server-side script, if you want server-side script to track a log entry in browser it won’t support. Chrome Logger have the feature to track the log entry in console for server-side script.
They support few platform to display the server-side scripting in console.
- Install Chrome Logger from Google Chrome web store.
- Click the extension icon to enable logging for the current tab’s domain (It will light up blue).
- Include the ChromePHP file into your script.
Simple example which will log the script-side script into console.
Chrome.php
<?php include 'ChromePhp.php'; // simple function will return content. function chromePHPExample() { return 'Welcome to ChromeLogger, you can see me in Google Chrome Console.'; } // below function will display the content from the chromePHPExample function // print in Google Chrome console ChromePhp::log(chromePHPExample());
ChromePHP have lots of logging method, you can also check below list.
- log – logs a variable to console
- warn – logs a warning to the console
- error – logs an error to the console
- group – sends a group log
- info – sends an info log
- groupCollapsed – sends a collapsed group log
- groupEnd – ends a group log
- table – sends a table log