CodeIgniter Forums
[SOLVED] - CI4 show errors not clearly - 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: [SOLVED] - CI4 show errors not clearly (/showthread.php?tid=77590)



[SOLVED] - CI4 show errors not clearly - nc03061981 - 09-21-2020

Dear,
I see CI4 show errors not clearly
• CI3 show errors clearly (error in file and in line, so clearly)

Any method to see errors clearly
??
Thanks for help


RE: CI4 show errors not clearly - captain-sensible - 09-27-2020

i'm not sure if anybody understands what you mean by not clear

i'm playing with "honeypot" and purposely triggering it (see image)

I got :
Code:
SYSTEMPATH/Honeypot/Exceptions/HoneypotException.php at line 25

Which shows a Honeypot exception triggered meaning basically i mimicked a bot so , it triggered .

To get that output i put in index.php which is is public the following line :


Code:
$_SERVER['CI_ENVIRONMENT'] = 'development';


i don't bother with .env since that just confuses me

What error code are you getting that are not clear ? give an example please


RE: CI4 show errors not clearly - nc03061981 - 09-27-2020

Example:
I am playing DashboardModel, if have errors:
- CI3 show: in file DashboardModel.php, error info, in line 1235
- CI4 show: not same CI3
Thanks captain-sensible for reply


RE: CI4 show errors not clearly - paulbalandan - 09-27-2020

in your app/Config/Log file, change the logThreshold to 4 instead of 3. Then check your logs again.


RE: CI4 show errors not clearly - demyr - 09-27-2020

You can do these steps to see the errors on CI4:

1- Config - Boot - Production,
 init_set('display_errors', '0'); Make the "0" -> "1".

2- Copy env file and rename .env
    (Line number was 17  I guess), CI_ENVIRONMENT production. Make it development. Not production.

You will be able to see the errors in detail.


RE: CI4 show errors not clearly - nc03061981 - 09-27-2020

(09-27-2020, 10:27 AM)paulbalandan Wrote: in your app/Config/Log file, change the logThreshold to 4 instead of 3. Then check your logs again.

Thanks but it not work

(09-27-2020, 01:15 PM)demyr Wrote: You can do these steps to see the errors on CI4:

1- Config - Boot - Production,
 init_set('display_errors', '0'); Make the "0" -> "1".

2- Copy env file and rename .env
    (Line number was 17  I guess), CI_ENVIRONMENT production. Make it development. Not production.

You will be able to see the errors in detail.

Thanks, I use
1- Config - Boot - Production,
init_set('display_errors', '0'); Make the "0" -> "1".

and it working fine
I can see very very detail of erros
Thanks @demyr


RE: CI4 show errors not clearly - nc03061981 - 09-27-2020

(09-27-2020, 01:15 PM)demyr Wrote: You can do these steps to see the errors on CI4:

1- Config - Boot - Production,
 init_set('display_errors', '0'); Make the "0" -> "1".

2- Copy env file and rename .env
    (Line number was 17  I guess), CI_ENVIRONMENT production. Make it development. Not production.

You will be able to see the errors in detail.

Working fine
Thanks for help


RE: CI4 show errors not clearly - paulbalandan - 09-28-2020

You should not change the Config\Boot\production file. From your use case it seems you are running in production environment but wants to run in development mode in order to see the errors in full detail.

Here are the steps to change the environment.
1. Copy the `env` file to `.env`. (Take note of the leading dot)
2. In the `.env` file, change the line of `CI_ENVIRONMENT = production` to `CI_ENVIRONMENT = development`. Also make sure to remove the beginning #.

Changes made to the Config\Boot\production will just be overridden in the next version update.


RE: CI4 show errors not clearly - nc03061981 - 09-28-2020

(09-28-2020, 02:19 AM)paulbalandan Wrote: You should not change the Config\Boot\production file. From your use case it seems you are running in production environment but wants to run in development mode in order to see the errors in full detail.

Here are the steps to change the environment.
1. Copy the `env` file to `.env`. (Take note of the leading dot)
2. In the `.env` file, change the line of `CI_ENVIRONMENT = production` to `CI_ENVIRONMENT = development`. Also make sure to remove the beginning #.

Changes made to the Config\Boot\production will just be overridden in the next version update.

Correct
Thanks for help

Thank you everyone for helping me fix the error.
Because I haven't copied the evn file and changed it to .evn, the change doesn't work.

Thank you once again for helping me gradually understand the problem.


RE: CI4 show errors not clearly - demyr - 09-28-2020

(09-27-2020, 05:31 PM)nc03061981 Wrote:
(09-27-2020, 01:15 PM)demyr Wrote: You can do these steps to see the errors on CI4:

1- Config - Boot - Production,
 init_set('display_errors', '0'); Make the "0" -> "1".

2- Copy env file and rename .env
    (Line number was 17  I guess), CI_ENVIRONMENT production. Make it development. Not production.

You will be able to see the errors in detail.

Working fine
Thanks for help

You're welcome. Enjoy it!