Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 500323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:04:32+00:00 2026-05-13T06:04:32+00:00

I have a generic Logger class that looks like this: class Logger { …

  • 0

I have a generic Logger class that looks like this:

class Logger {

  ...
  
  public function add($userId, $siteId, $logTypeId, $message) {
    $Log = LogMapper::create();
    $Log->setUserId($userId);
    $Log->setSiteId($siteId);
    $Log->setLogTypeId($logTypeId);
    $Log->setMessage($message);
    $Log->save();
    
    ...
  }
  
  ...

}    

And the Log class:

class Log {
  
  public function setUserId($userId) {
    if ($this->userId !== $userId) {
      $this->userId = $userId;
    }
    
    return $this;
  }
  
  public function getUserId() {
    return $this->userId;
  }

  public function setSiteId($siteId) {
    if ($this->siteId !== $siteId) {
      $this->siteId = $siteId;
    }
    
    return $this;
  }
  
  public function getSiteId() {
    return $this->siteId;
  }

  ...

}

As well as the LogMapper class:

class LogMapper extends DataMapper {

  ...

  public static function create($row = false) {
    return new Log($row);
  }

  public static function getById($id) {
    ...
  }

}

As you can see, I have two other classes, LogMapper and Log, which Logger uses to write records to a database.

I also have a mechanism that emails me when a fatal error occurs. I received the following in about a dozen emails:

Call to undefined method Log::setUserId()

My application uses autoloading, and I first thought that may be the problem, but clearly the Logger class is being loaded, and so autoloading has not broken. The path for the Log class is correct in the autoloader…and clearly the Log class has been loaded–otherwise a "Class ‘Log’ not found" error would have been thrown.

Any ideas what may be causing this error? I do use eAccelerator on the release.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:04:32+00:00Added an answer on May 13, 2026 at 6:04 am

    Long shot, but do you have PEAR’s Log class installed? This is something I ran across a while back. I tried to make a ‘Log’ class but it was colliding with PEAR’s.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 266k
  • Answers 266k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Google uses flash for this. Something similar might be possible… May 13, 2026 at 12:42 pm
  • Editorial Team
    Editorial Team added an answer Another approach would be as follows: Have a ManualResetEvent in… May 13, 2026 at 12:42 pm
  • Editorial Team
    Editorial Team added an answer You can download the full redistributable here, which was taken… May 13, 2026 at 12:42 pm

Related Questions

I have a question regarding handling errors in a J2EE application. Our current application
I have a method with this signature: protected final Map<String, Object> buildOutputMappings( AbstractDataObject ado,
My intend is to create a simple easily debuggable console application which will be
I have a legacy class that the class itself is not a generic but
I have a C# interface with certain method parameters declared as object types. However,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.