title: log4php will not work properly
body: <p>So I recently discovered that the log4* package was available for PHP and upon seeing this eagerly downloaded the latest from the log4php website and followed the installation instructions.  The instructions indicate that one is to download the tar package, untar, and place the following directory in a place of one's choosing:  log4php/src/main/php</p>
  
  <p>Therefore I copied the contents of <code>log4php/src/main/php</code> into my lib dir under lib/log4php.</p>
  
  <p>In my script, as required, I required the 'Logger.php' class and indicated a properties file to manage my appenders.  The properties file, log4php.properties, is located on my filesystem at "/home1/ioforgec/www/devlab/pnotes/config/log4php.properties".  </p>
  
  <p>Here is the logfile content:</p>
  
  <pre><code>#
  # Example Logger
  #
  log4php.appender.EA1 = LoggerAppenderConsole
  log4php.appender.EA1.target = STDOUT
  log4php.appender.EA1.layout = LoggerLayoutPattern
  log4php.appender.EA1.ConversionPattern = "%m"
  log4php.appender.EA1.threshold = FATAL
  log4php.exampleLogger = FATAL, EA1
  </code></pre>
  
  <p>So here is a copy of my script that implements (more or less 'wraps' the log4php functionality):</p>
  
  <pre><code>&lt;?php
  
  require_once('/home1/ioforgec/www/devlab/pnotes/lib/log4php/Logger.php');
  
  class LogUtil
  {
      public $logger;
  
      public $properties_file = "/home1/ioforgec/www/devlab/pnotes/config/log4php.properties";
  
      public static function logExample($msg)
      {
          Logger::configure($properties_file);
          $logger = Logger::getLogger("example");
          $logger-&gt;debug("Shouldnt see this print because of config max level FATAL");
          $logger-&gt;fatal($msg);
      }
  }
  ?&gt;
  </code></pre>
  
  <p>In order to test that this is working properly, the following script calls the LogUtil.php shown above:</p>
  
  <pre><code>#!/usr/bin/php
  &lt;?php
  require_once("lib/utils/LogUtil.php");
  LogUtil::logExample("example message");
  ?&gt;
  </code></pre>
  
  <p>So, despite configuring the example logger to format the messages as the plain message, despite setting the level of the logger to a max of FATAL, not only in the logger declaration but also in the threshold command, the print to the console looks to me like the default root logger:</p>
  
  <pre><code>Mon Oct 18 20:30:05 2010,705 [827] DEBUG example - Shouldnt see this print because of config max level FATAL
  Mon Oct 18 20:30:05 2010,711 [827] FATAL example - example message
  </code></pre>
  
  <p>I see the print statement without the plain formatting as specified, and I see two print statements, the debug print (which should never have printed due to the setting of FATAL on the logger config - FATAL is MUCH higher than DEBUG)</p>
  
  <p>What on earth am I doing wrong?  Ive tried every combination of setup I can possibly think of.  Does anyone have any suggestions?</p>
  
  <p>Edit - Update - This is still an issue.  No progress.</p>
  
  <p>Edit2 - Really?  Has no one on this forum tried to use this very popular logging package and its incarnation as a PHP module?</p>
  
  <p>I have tried every conceivable avenue to try and get my question answered, including the log4php user's mailing list.</p>