Hi all,

I am fairly new to PHP (my experience is mostly in Java) and I have inherited a project that was initially implemented in PHP4. I am updating it to use PHP5 and at the same time I am trying to add Logging to the project. I am using the Pear Log package for this purpose, but I am having a bit of trouble getting it going. I am attempting to use a File Handler and my setup code looks like this:

class Booking
{
  private $log;
  public function Booking()
  {
    $this->log = &Log::singleton('file', 'log.txt', 'Booking');
    $this->log->setMask(PEAR_LOG_ALL);
  }
}

Then when I try to log something I write

public function getBookingTime()
{
  $this->log->debug("getBookingTime() entered.");
  return $this->bookingTime;
}

After I run my code I can't find a log.txt file anywhere. I also tried using a console handler to see if I could get the log output to console, but this also failed. Am I missing something here?

Thanks in advance for any advice,
darkagn

The problem was that I had permission for writing a file, but the g and o permissions did not. Changing their settings worked. Thanks pritaeas! :)

This question has already been answered. Start a new discussion instead.