topical media & game development

talk show tell print

professional-php-11-newLoggerClassTest.php / php



  <?php
  
  Logger::register('errors', 'file:
var/log/error.log');

Logger::register('app, 'pgsql://postgres@db/errors?table=applog&timestamp=dtlog&' . 'msg=smesg&level=slevel&module=smod'); objQLog = Logger::getInstance('queries'); sql = "SELECT * FROM foo"; objQLog->logMessage("Selecting all foos"); try { Database->getInstance()->select(sql); } catch (DBQueryException e) { objErrLog = Logger::getInstance('errors'); objErrLog->logMessage(e->getMessage(), LOGGER_CRITICAL); } ?>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.