Jump to content

Archived

This topic is now archived and is closed to further replies.

ballhogjoni

Where can I find where CakePHP logs errors?

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?

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

Cake's builtin logging only occurs when you use it. 

 

how do you use it? I've read the docs and have implemented it or so I thought.

 

Also, will you show me how to enable both?

Share this post


Link to post
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.");

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×
×
  • 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.