I want to use log_message in Codeigniter but log_message does not write anything in the log file.
$config['log_threshold'] = 4;
$config['log_path'] = 'http://spsvn01/var/www/html/RAIDLOG/application/logs/';
And in my controller I write :
log_message('error','USER_INFO '.$user_info['email']);
Thanks a lot !
open the your_project_dir/application/config/config.php
In config file you'll find 3 default variables
Error Status are already defined In
your_project_dir/system/core/Log.php
You've to assign array i.e for errors and info array(1, 2) Method log_message('', '') accepts 2 parameters. First parameter is level (i.e. ERROR or DEBUG or INFO or ALL) & second parameter is message.
Example:
Remember All default php errors will be part of the log if you assign
For custom Logs: You've to add a new array element in your_project_dir/system/core/Log.php i.e.
Now you can call method as
I would use FCPATH
$config['log_path'] = FCPATH . '/application/logs/';
once you have set path refresh page. $config['log_threshold'] = 4;Works fine on my end.
http://www.codeigniter.com/user_guide/general/errors.html
Informational Messages
Error Messages
Folder Must Be Writable CHMOD 700
Just as simple like this: