CodeIgniter Forums
error is logged. but it does not throw an exception. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: error is logged. but it does not throw an exception. (/showthread.php?tid=90805)



error is logged. but it does not throw an exception. - mywebmanavgat - 05-07-2024

writes the following error to the codeigniter log file.

However, it does not throw an error in the output even though the project is in developer mode.

I am aware of the cause and the solution, but you won't notice it if you don't review the logs during the development process. Why can't we see it on the screen?

WARNING - 2024-05-07 21:05:38 --> [DEPRECATED] Creation of dynamic property App\Libraries\Template::$__version is deprecated in APPPATH/Libraries/Template.php on line 30.
1 APPPATH/Controllers/BaseController.php(41): App\Libraries\Template->setData('version', '2.0.0.1a1')
2 APPPATH/Controllers/Approval.php(10): App\Controllers\BaseController->__construct()
3 SYSTEMPATH/CodeIgniter.php(903): App\Controllers\Approval->__construct()
4 SYSTEMPATH/CodeIgniter.php(500): CodeIgniter\CodeIgniter->createController()
5 SYSTEMPATH/CodeIgniter.php(355): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
6 SYSTEMPATH/Boot.php(312): CodeIgniter\CodeIgniter->run()
7 SYSTEMPATH/Boot.php(67): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
8 FCPATH/index.php(57): CodeIgniter\Boot::bootWeb(Object(Config\Paths))


RE: error is logged. but it does not throw an exception. - kenjis - 05-07-2024

It seems by default DEPRECATED errors are logged.
Change the following setting.

PHP Code:
--- a/app/Config/Exceptions.php
+++ b/app/Config/Exceptions.php
@@ -67,+67,@@ class Exceptions extends BaseConfig
      
* Use this option to temporarily cease the warnings and instead log those.
      This option also works for user deprecations.
      */
-
    public bool $logDeprecations true;
+
    public bool $logDeprecations false;

    /**
      * --------------------------------------------------------------------------