You are here

class LdapDetailLog in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_servers/src/Logger/LdapDetailLog.php \Drupal\ldap_servers\Logger\LdapDetailLog

The detailed logger for the LDAP modules.

This logger is only active the ldap_help setting watchdog_detail is active. When it is, it passes messages to the regular logger with priority debug.

Hierarchy

Expanded class hierarchy of LdapDetailLog

3 files declare their use of LdapDetailLog
GroupUserUpdateProcessor.php in ldap_user/src/Processor/GroupUserUpdateProcessor.php
LoginValidator.php in ldap_authentication/src/Controller/LoginValidator.php
TokenProcessor.php in ldap_servers/src/Processor/TokenProcessor.php
1 string reference to 'LdapDetailLog'
ldap_servers.services.yml in ldap_servers/ldap_servers.services.yml
ldap_servers/ldap_servers.services.yml
1 service uses LdapDetailLog
ldap.detail_log in ldap_servers/ldap_servers.services.yml
Drupal\ldap_servers\Logger\LdapDetailLog

File

ldap_servers/src/Logger/LdapDetailLog.php, line 14

Namespace

Drupal\ldap_servers\Logger
View source
class LdapDetailLog {

  /**
   * LdapDetailLog constructor.
   *
   * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $factory
   *   Logger factory.
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config
   *   Config factory.
   */
  public function __construct(LoggerChannelFactoryInterface $factory, ConfigFactoryInterface $config) {
    $this->loggerFactory = $factory;
    $this->config = $config
      ->get('ldap_help.settings');
  }

  /**
   * If detailed logging is enabled, log to Drupal log more details.
   *
   * @param string $message
   *   Log message.
   * @param array $context
   *   Values to replace in log.
   * @param string $module
   *   Logging channel to use.
   */
  public function log($message, array $context = [], $module = 'ldap_servers') {
    if ($this->config
      ->get('watchdog_detail')) {
      $this->loggerFactory
        ->get($module)
        ->debug($message, $context);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LdapDetailLog::log public function If detailed logging is enabled, log to Drupal log more details.
LdapDetailLog::__construct public function LdapDetailLog constructor.