• Archives

  • Categories

Apr 03

How to do logging in CakePHP

Okay, I realized this long ago but it annoys me that every time I just forget this. Sometime, when debugging CakePHP, the most direct method is to simply log an error. It’s like ‘trace’ in Actionscript or just a println() in Java. Anyway, here it is:

$this->log("Log anything here.");

This can be called from the controller.

And can find the log here:

\app\tmp\logs\error.log

Maybe someone who drops by may just find this useful too.

Possibly related:

  1. How to do a parseInt in…
  2. Java SE 6 Update 10 is out: it’s the new one
  3. How to get the controller’s action name from the view
  4. How to perform routing in CakePHP 1.2

No comments yet. Leave yours here.


WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.