title: Log4PHP only logging last method call
body: <p>I'm a relatively new PHP programmer, my background is in Java. My question involves attempting to log function call entry and exits using Log4PHP. I am following a loose MVC pattern where I have PHP pages that render the view, PHP scripts to act as controller and PHP classes representing the model.</p>
  
  <p>This is what is happening: I have a form that submits to the PHP controller, which then instantiates a PHP class. The newly created object does an insert into MySQL, returning the new auto-increment ID. Control then passes back to the controller, which forwards to a different PHP view, using header->location. Finally, the new PHP view does a select on the newly created ID.</p>
  
  <p>The problem is that during this execution process, ONLY the lookup is being logged by Log4PHP; the INSERT is not. Here are some snippets:</p>
  
  <pre><code>&lt;appender name="myConsoleAppender" class="LoggerAppenderConsole" /&gt;   
  &lt;appender name="myLoggerAppenderDailyFile" class="LoggerAppenderDailyFile"&gt;
   &lt;layout class="LoggerLayoutPattern"&gt;
         &lt;param name="conversionPattern" value="%d{Y-m-d H:i:s} [%p] %c: %m (at %F line %L)%n" /&gt;
     &lt;/layout&gt;
     &lt;param name="file" value="file-%s.log" /&gt;
     &lt;param name="datePattern" value="Y-m-d" /&gt;
  &lt;/appender&gt;
  &lt;logger name="merchant"&gt;
  &lt;appender_ref ref="myLoggerAppenderDailyFile" /&gt;
  &lt;/logger&gt;   
  &lt;root&gt;
  &lt;level value="DEBUG" /&gt;
  &lt;appender_ref ref="myConsoleAppender" /&gt;
  &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The constructor:</p>
  
  <pre><code>public function __construct() {
  .
  .
  Logger::configure('config.xml');
  $this-&gt;log = Logger::getLogger(__CLASS__);
  }
  </code></pre>
  
  <p>The two methods:</p>
  
  <pre><code>public function insertMerchant() {
  $this-&gt;log-&gt;debug("Inserting new Merchant");
  .
  .
  $this-&gt;log-&gt;debug("Merchant Inserted; ID = $merchantId");
  }
  
  public function findMerchantByUserId($userId) {
  $this-&gt;log-&gt;debug("Finding Merchant with userId = $userId");
  .
  .
  $this-&gt;log-&gt;debug("Merchant found with userId = $userId");
  }
  </code></pre>
  
  <p>As I mentioned, ONLY the LAST call to findMerchantByUserId($userid) is being logged to file. The insert is never logged,</p>
  
  <p>Thanks in advance for any help.</p>