Hi all,

I would like to recieve a daily diggest of what has happened in my
app, as well as to display it on the admin interface. So I decided to
implement a custom log function, because the core one (CakeLog) can't
log to database.

Then a problem arise:

1.- If I do it with a model/controller pair, I can log from my
controllers, but cannot from my models.
2.- If I do it with as a vendor class and import it from my app, I
cannot use $model->save() or $model->find().

Regarding method [1], I'am currently using something like this:

class AppModel extends Model {

  function afterDelete() {
    CakeLog::write(LOG_DEBUG, "[{$this->name}] Deleted id #{$this-
>id}");
  }

  function afterSave() { <same> }

}

I'm interested in best-practices, not tricks. Any idea?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to