简体   繁体   中英

Need a help on logs with codeigniter?

I have used codeigniter framework.Have used its log part. I had a query regarding configuring logs in the application. As per the documentation they say that we can configure in app/config/php and filter the logs as debug,error or info messages. But even after doing that, I am not able to filter the logs. Wanted to know the reason for this or am i missing something. Help would be highly appreciated.

You need to follow the following steps to keep log file.

  1. Change the following line of your application/config/config.php file

     $config['log_threshold'] = 4; 

    instead of

     $config['log_threshold'] = 0; 

This change will produce a log file in your application/logs directory with current date as file name.

Now if you want to write your custom log in this log file then write the following code:

log_message('ERROR','YOUR_MESSAGE_HERE');

Here you can use 'ERROR', 'DEBUG' etc.

Hope this will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM