fatnjazzy fatnjazzy - 4 months ago 38
PHP Question

CodeIgniter Error Log Info + Errors

IS there a way to save in the log, Info + Errors without debug?

Howcome debug level apears with info?

If i want to log info "Account id 4345 was deleted by Admin", why do i need to see all of these:

DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Hooks Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 URI Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Router Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Output Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Input Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Global POST and COOKIE data sanitized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Language Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Loader Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config file loaded: config/safe_charge.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config file loaded: config/web_fx.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: loadutils_helper
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: objectsutils_helper
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: logutils_helper
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: password_helper
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Database Driver Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 cURL Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Language Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Account MX_Controller Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/pending_account_model.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/proccess_accounts_model.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/web_fx_model.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/trader_account_type_spreads.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/trader_accounts.php
DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized


Thanks

Answer

From CodeIgniter's docs:

log_message('info', 'The purpose of some variable is to provide some value.');

Informational Messages. These are the lowest priority messages, simply giving information regarding some process. CodeIgniter doesn't natively generate any info messages but you may want to in your application.

Note: In order for the log file to actually be written, the "logs" folder must be writable. In addition, you must set the "threshold" for logging. You might, for example, only want error messages to be logged, and not the other two types. If you set it to zero logging will be disabled.

Comments