tpdev
tpdev

Reputation: 1

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.

Upvotes: 0

Views: 65

Answers (1)

Ariful Islam
Ariful Islam

Reputation: 7675

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.

Upvotes: 1

Related Questions