Uploaded image for project: 'Log4php'
  1. Log4php
  2. LOG4PHP-143

LoggerConfiguratorPhp does not accept INT constants for appender threshold

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0
    • None
    • None

    Description

      When you specify a threshold in a Php configuration file using the typical LoggerLevel::_____ constants (such as LoggerLevel::ALL), the operation fails to set the proper threshold on the appender and it always defaults to DEBUG.

      If you specify a string for the threshold, then it works properly.

      For example:
      $config['appenders']["email"] = array(
      'class' => 'LoggerAppenderMailEvent',
      'to' => $email,
      'from' => variable_get('site_mail', ini_get('sendmail_from')),
      'subject' => "log4php event on $hostname",
      'layout' => $layout,
      'threshold' => LoggerLevel::FATAL
      );

      fails and sets the logger level to DEBUG, while this:

      $config['appenders']["email"] = array(
      'class' => 'LoggerAppenderMailEvent',
      'to' => $email,
      'from' => variable_get('site_mail', ini_get('sendmail_from')),
      'subject' => "log4php event on $hostname",
      'layout' => $layout,
      'threshold' => 'FATAL'
      );

      works properly.

      Attachments

        Activity

          People

            juice Ivan Habunek
            jcherniak Justin Cherniak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: