CodeIgniter Forums
How to configure error reporting in CodeIgniter 4? - 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: How to configure error reporting in CodeIgniter 4? (/showthread.php?tid=87517)



How to configure error reporting in CodeIgniter 4? - WilnarMasonmg - 04-27-2023

After installing and configuring CI 4 I can see the home controller and the debug bar as normal (I'm in development mode).

There is a problem with error reporting. If I try to deliberately write some wrong PHP code, CodeIgniter overrides the normal PHP behaviour and hides the errors (in development mode!!).

Here's an example of deliberately adding a PHP error to the home controller:

<?php namespace App\Controllers;

class Home extends BaseController
{
    public function index()
    {
        this is an error!! ()
        return view('welcome_message');
    }

}
Here's the output (which is not helpful with real errors):

No direct script access allowed
How can I set CodeIgniter 4 to show PHP errors? (the error is not even logged anywhere inside the server)


RE: How to configure error reporting in CodeIgniter 4? - InsiteFX - 04-27-2023

app/Config/Logger.php thats were you setup CodeIgniters Error Log filing.