Codeigniter logging

At the moment CI lets you specify a logging level. 0 is off, 1 to 3 are different subsets and 4 shows all messages.

Is it possible to tell Codigniter to log errors and informational messages but not debug messages? (Essentially setting the log threshold to an array?)

Extend the Log library, and alter the sequence of the levels:
var $_levels    = array('ERROR' => '1', 'DEBUG' => '2',  'INFO' => '3', 'ALL' => '4');

The rule is that the log_threshold set, and all values lower, are written to the logfile. So if you want ERROR and INFO, but not DEBUG, change the above to
var $_levels    = array('ERROR' => '1', 'INFO' => '2',  'DEBUG' => '3', 'ALL' => '4');
and set the log_threshold to 2.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.