Welcome Guest, Not a member yet? Register   Sign In
Undefined Variable _POST in system/Log/Logger.php
#1

I recently upgraded from CI 3 to CI 4.2.1 (running on php 7.4). My site seems to be running well, but I see continuous errors in my log files about _POST being undefined in system/Log/Logger.php.

The threshold is set to 4 in both the app/Config/Logger.php file and .env.

Here is a sample from my log file:

Code:
[28-Sep-2022 07:16:49 America/Los_Angeles] PHP Fatal error:  Uncaught ErrorException: Undefined variable: _POST in /var/www/system/Log/Logger.php:340
Stack trace:
#0 /var/www/system/Log/Logger.php(340): CodeIgniter\Debug\Exceptions->errorHandler(8, 'Undefined varia...', '/var/www/system...', 340, Array)
#1 /var/www/system/Log/Logger.php(266): CodeIgniter\Log\Logger->interpolate('{message}\nin {e...', Array)
#2 /var/www/system/Common.php(794): CodeIgniter\Log\Logger->log('critical', '{message}\nin {e...', Array)
#3 /var/www/system/Debug/Exceptions.php(109): log_message('critical', '{message}\nin {e...', Array)
#4 /var/www/system/Debug/Exceptions.php(168): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#5 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#6 {main}
  thrown in /var/www/system/Log/Logger.php on line 340

Anyone have any insights?
Reply
#2

Are you placing the $_POST array into the log file some place in your code?
If so check your code, there are big changes to CodeIgniter 4 from 3.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB