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');

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,

8 Years
Discussion Span
Last Post by 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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.