LoggerChannel::MAX_CALL_DEPTH

Same name in other branches
  1. 9 core/lib/Drupal/Core/Logger/LoggerChannel.php \Drupal\Core\Logger\LoggerChannel::MAX_CALL_DEPTH
  2. 8.9.x core/lib/Drupal/Core/Logger/LoggerChannel.php \Drupal\Core\Logger\LoggerChannel::MAX_CALL_DEPTH
  3. 11.x core/lib/Drupal/Core/Logger/LoggerChannel.php \Drupal\Core\Logger\LoggerChannel::MAX_CALL_DEPTH

Maximum call depth to self::log() for a single log message.

It's very easy for logging channel code to call out to other library code that will create log messages. In that case, we will recurse back in to LoggerChannel::log() multiple times while processing a single originating message. To prevent infinite recursion, we track the call depth and bail out at LoggerChannel::MAX_CALL_DEPTH iterations.

File

core/lib/Drupal/Core/Logger/LoggerChannel.php, line 28

Class

LoggerChannel
Defines a logger channel that most implementations will use.

Namespace

Drupal\Core\Logger

Code

const MAX_CALL_DEPTH = 5;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.