How to disable logging in Codeigniter?

How to disable logging in CodeIgniter?

My application has 3 applications, and my first 2 application logs are written to the general log directory. Thus, it became difficult to maintain log files.

So please help me write logs in other preferred places in my application or help me turn off logging.

+8
php logging codeigniter
source share
3 answers

Logging can be configured for each application made in

/application/config.php 

This parameter has the value $config['log_path'] .

If you want to disable logging, set the threshold to 0:

 $config['log_threshold'] = 0; 

But I'm a little surprised if you have three applications, why they are in the same journal folder. Each application must have its own log folder.

+9
source share

See index.php for each application:

 /* * ------------------------------------------------------------------- * CUSTOM CONFIG VALUES * ------------------------------------------------------------------- * * The $assign_to_config array below will be passed dynamically to the * config class when initialized. This allows you to set custom config * items or override any default config values found in the config.php file. * This can be handy as it permits you to share one application between * multiple front controller files, with each file containing different * config values. * * Un-comment the $assign_to_config array below to use this feature * */ // $assign_to_config['name_of_config_item'] = 'value of config item'; 

I have never personally used this, but it seems that every single application can override settings in config.php using a common application. Therefore, you should be able to do something similar in each individual index file:

 $assign_to_config['log_threshold'] = 0; // OR $assign_to_config['log_path'] = 'app3/logs/'; 
+2
source share

try it

 $this->log->enable_logging(FALSE); error_reporting(0); 
0
source share

All Articles