CI4 Whoops additions if and only if LOCALHOST |
I use Ubuntu 19.04 and have added these lines in index.php to clear the LOCALHOST log file:
file: index.php PHP Code: # MAYBE EMPTY TRASH IF AND ONLY IF LOCALHOST And also modified the following file: /app/Views/errors/html/production.php PHP Code: <?php // DECLARE(STRICT_TYPES=1); Output: I use Ubuntu 19.04 and have modified the following file for a better Whoops:
whoops appear if your app in production mode. Solution for this, set ENVIRONTMENT in develope mode
Why would you need to clear the log directory? Do you need disk space so badly?
Also @titounnes is right, just set the environnement to development and it will display the errors in a much better format!
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
>>> Why would you need to clear the log directory?
The log directory is only cleared on LOCALHOST. It is much simpler view the errors for this particular page rather than include all the historical logs - which no doubt are not relevant. >>> Do you need disk space so badly? No but why complicate the issue when debugging - only relevant errors are shown >>> Also @titounnes is right, just set the environnement to development and it will display the errors in a much better format! When the environment is set to development the scripts called to produce the page are not identical and may not even show any errors. Try adding this incorrect syntax: file: /app/Config/Boot/production.php $badScript = $x / ' A non-numeric value encountered'; Environment Results: production show blank screen or default message. development does not show any errors because "/app/Config/Boot/production.php" not called.
(09-29-2019, 07:44 AM)John_Betong Wrote: When the environment is set to development the scripts called to produce the page are not identical and may not even show any errors. Try adding this incorrect syntax: Of course if you have an error in your production config file, the error will only happen on production environment. I personally don't like having a script auto-deleting files. But if this works for you, that's ok too!
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
@includebeer
> Of course if you have an error in your production config file, > the error will only happen on production environment. The supplied example demonstrates that setting "environment to development..." will not detect any errors. I wonder if there are other situations where this could occur. I think sending either "production" or "development" to a common file would have solved the problem. > I personally don't like having a script auto-deleting files. > But if this works for you, that's ok too! I personally don't like having to delete historical log files on my localhost and prefer a cleaner file structure. |
Welcome Guest, Not a member yet? Register Sign In |