PHP warning not logged in production env |
I recently stepped in a real problem that I can't overcome. Whenever I switch my application from development mode to production mode, CI4 stops logging my PHP warning.
For example this code : PHP Code: $bar = 20; Should throw a warning Undefined variable $foo Everything's alright in my development environment with this log : Code: CRITICAL - 2021-03-01 08:44:52 --> Undefined variable: foo But nothing happens if I switch to CI_ENVIRONMENT = production. Warning is bypassed and not logged. I tried to switch the $threshold variable in app/Config/Logger.php to 5 or 9 or even an array of different values but it doesn't change anything. Did you witness such a behavior in your app? Should I open an issue in GitHub or am I missing something here? (03-01-2021, 01:20 AM)kenjis Wrote: You have to change the boot file. Thank you it worked well However I don't find any mention of this in the documentation, might be a little PR coming in.
Yes, probably this is undocumented.
There is a short description about boot files, https://codeigniter4.github.io/CodeIgnit...boot-files but it might be better that the logging page has a note about this. |
Welcome Guest, Not a member yet? Register Sign In |