PageRenderTime 65ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/libraries/Steam/Log/Writer/PHP.php

https://gitlab.com/braydon/wordpress-steam-framework
PHP | 43 lines | 13 code | 2 blank | 28 comment | 1 complexity | c92cbad488b5828ad13b6b96d05d2e1e MD5 | raw file
  1. <?php
  2. /**
  3. * PHP Log Writer
  4. *
  5. * This class allows errors to be logged through PHP's default facility.
  6. *
  7. * Copyright 2008-2009 Shaddy Zeineddine
  8. *
  9. * This file is part of Steam, a PHP application framework.
  10. *
  11. * Steam is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * Steam is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. * @category Frameworks
  25. * @package Steam
  26. * @copyright 2008-2009 Shaddy Zeineddine
  27. * @license http://www.gnu.org/licenses/gpl.txt GPL v3 or later
  28. * @link http://code.google.com/p/steam-fw
  29. */
  30. namespace Steam\Log\Writer;
  31. class PHP extends \Zend_Log_Writer_Abstract
  32. {
  33. protected function _write($event)
  34. {
  35. if (false === @error_log($event['message']))
  36. {
  37. throw new \Zend_Log_Exception("Unable to log using PHP's default logging facility.");
  38. }
  39. }
  40. }