[geeklog-devel] 1.5 error.log when DB dies

Tony Bibbs tony at tonybibbs.com
Wed Aug 13 10:50:11 EDT 2008


I just found out something interesting.  With 1.5 having all config setting in the DB if your DB dies clues on why your site is down may not be immediately obvious be reading the standard logs/error.log.  Why?  DB's dead so it can't read config setttings on where error.log resides so it write error.log in the directory of the script that first encounters the MySQL error.  For many of you it may be right in public_html/.  In my case it was in staticpages/ because I have a staticpage in a block on the homepage.

Couple of options:
1) Cache the location of the log directory using PEAR's Cache_Lite or Zend_Cache.  By caching the location to the log dir to a file you get out of this, yet, still allow use of DB-settings.
2) Document this behavior if we decide to do nothing.
3) Simply add the log directory setting to the db-config file.  

I think #2 is a bad idea because now the error log is publicly accessible because it's in the web tree (this assumes your webserver could even write there in the first place which is probably a bad thing...something I know I plan on fixing in my case.

I think the best option is #1.

Food for thought.

--Tony




More information about the geeklog-devel mailing list