How can I disable logging in CodeIgniter?
My application has 3 applications and my first 2 applications' logs are written into the common logs directory. So it has become difficult to maintain the log files.
So please help me in writing the logs in the other preferable locations in my application or help me disable logging.
No need to type a long query to disable error reporting in codeigniter. Use error_reporting(0); in the page to disable displaying errors in that page.
Logging can be configured per application, it's done in
/application/config.php
The setting in question is $config['log_path']
.
If you want to disable logging, set the threshold to 0:
$config['log_threshold'] = 0;
But I wonder a bit if you have three applications why they log into the same log folder. Each application should have it's own log folder.
Take a look in 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've never personally used this, but it seems to suggest that each separate app can override the settings in config.php
using a shared application. So you should be able to do something like this in each individual index file:
$assign_to_config['log_threshold'] = 0;
// OR
$assign_to_config['log_path'] = 'app3/logs/';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With