Created: 2011-07-06 21:05
Updated: 2017-05-02 07:15
License: other

The console library is a implemenation of the firephp class ( It allows you to send log message from the server that display in the firebug console (when the firephp plugin is installed)


// load the spark

// ($type, $message, $write_to_file);
$this->console->log('this will show an error in firebug', 'error', FALSE);

// or use the alias console_log()
console_log('This is my log message', 'log', FALSE);
console_log('This is my error message, also written to a log file', 'error', TRUE);

// set the log path or file name
$this->console->log_path = APPATH.'logs/';
$this->console->log_file = 'console-'.date('y-m-d h-i-s.php');

To disable the firebug headers(logs will still be written to file), change this setting in config/console.php

$config['console_active'] = FALSE;

Supported log types are:

  • log
  • info
  • warn
  • error

There do seem to be limitations with how big the objects/arrays that you log out are - of your page is not refreshing properly, thats probably the problem.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more