Welcome Guest, Not a member yet? Register   Sign In
Anybody in favour of using PHP error reporting instead of Kint?
#4

Further improvements to the Original Post #1... modified the following:

File:  ./app/Config/Boot/production.php
<?php
PHP Code:
/*
 |--------------------------------------------------------------------------
 | ERROR DISPLAY
 |--------------------------------------------------------------------------
 | Don't show ANY in production environments. Instead, let the system catch
 | it and display a generic error message.
 */
ini_set('display_errors''0');
/*
 |--------------------------------------------------------------------------
 | DEBUG MODE
 |--------------------------------------------------------------------------
 | Debug mode is an experimental flag that can allow changes throughout
 | the system. It's not widely used currently, and may not survive
 | release of the framework.
 */
defined('CI_DEBUG') || define('CI_DEBUG'false);

# John 2021-06-28
  error_reporting(-1); // MAXIMUM ERROR REPORTING
  define('CI_ERROR_LOG''../writable/logs/log-' .date('Y-m-d') .'.log');
  ini_set('error_log'CI_ERROR_LOG);

  if( 'localhost'===$_SERVER['SERVER_NAME'] ):
    ini_set('display_errors''true');
  endif; 
[/php]

The advantage is that both local and online application will raise an error log page and only display errors locally. 

I think it is far better to log errors raised by the  Online Application rather than ignore errors by setting error_reporting(0);
Reply


Messages In This Thread
RE: Anybody in favour of using PHP error reporting instead of Kint? - by John_Betong - 06-27-2021, 11:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB