Welcome Guest, Not a member yet? Register   Sign In
change config['log_path'] on the fly
#1

I am trying to specify my log directory from MY_Controller (my base class for application/controllers/*.php) depending on the controller class being called. The clog directory was specified using 
Code:
$this->config->set_item("log_path",APPPATH.'logs'.DIRECTORY_SEPARATOR.$this->router->class.DIRECTORY_SEPARATOR);

in the MY_Controller::__construct(). I have a custom log function in MY_Controller::log() which in turn calls CI's log_message().
All the possible log directories exists and have permission of 777. 

Code:
$this->config->item('log_path');

 always return the correct expected log directory.
The issue despite the default log directory being changed successfully to another directory, the string to be logged is being logged into the default log directory (application/logs).
Any help will be appreciated. Thanks.
Reply


Messages In This Thread
change config['log_path'] on the fly - by eminence - 03-01-2018, 01:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB