Welcome Guest, Not a member yet? Register   Sign In
CI3 - Logging Threshold Per Environment
#1

Hi there!

As the title suggests, I'm try to configure separate logging thresholds based on the environment value. I've seen similar posts including this helpful blog post which essentially spells out what I'm trying to accomplish, but I can't quite seem to get this right.
I have a per-configuration folder for development and production environments both consisting of a single custom.php file that looks like:
<?php defined('BASEPATH') or exit('No direct script access allowed'); // @codingStandardsIgnoreLine

$config['log_threshold'] = 4;

/* End of file custom.php */
/* Location: ./application/config/development/custom.php */

I can see this configuration file is loaded and consumed properly, but it appears that the logging class (CI_Log) has already consumed the base configuration file's value for log_threshold and I don't believe there's anything that would trigger it to be updated.
Am I missing something here?

Thanks,
Tony
Reply
#2

It figures that shortly after I make this post I undercover the solution  Big Grin
The problem was my per-environment configuration sections were defined in a file named custom.php and not in the special filename of config.php. The custom.php was then leveraging the autoloader to be consumed, which happens well after the configuration class - and more importantly the log_message function - are initialized.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB