Jump to content

Where can I find where CakePHP logs errors?


ballhogjoni

Recommended Posts

I am new to CakePHP. I have checked app/tmp/logs/*.log for errors but nothing is logging there. I checked my apache error log, but nothing there. I checked php.ini for where the errors are being logged but that section is commented out. I checked my virtual host for error logging but nothing in my virtual host. I know there are server side errors because my browser gets a 500 internal server error.

 

Where are the errors being logged? How do I find this out?

Link to comment
Share on other sites

If what you say is true, no php error logging and no apache error logging, then there isn't any logging happening.  Enable both.  PHP's error_log should always be setup, even in a production environment, but especially in a development one.  Apache's error log should also be on, it can be a helpful diagnostic aid.  Cake's builtin logging only occurs when you use it. 

Link to comment
Share on other sites

Apache Error Logging. Put it in your <VirtualHost>

ErrorLog "relative/path/to/your/site/error.log"

 

PHP Error Logging The php.ini is pretty well documented too.

log_errors = true
error_log = "/path/to/your/error_log"

 

All cakephp classes derived from Object class have a log method.  Most of the time its a matter of $this->log("Hello World.");

Link to comment
Share on other sites

thanks for the help thehippy

 

I saw this $this->log("Hello World."); in the docs but couldn't ever get it to log. This is on of the major reasons for this thread. I add this on the first line of the __construct function to the dispatcher class, I tail app/tmp/logs/*.log (error.log and debug.log) and I don't get any output.

 

What am I missing?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.