Base for a static organization website

LogPanel.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  10. * @link http://cakephp.org CakePHP(tm) Project
  11. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  12. */
  13. App::uses('DebugPanel', 'DebugKit.Lib');
  14. /**
  15. * Log Panel - Reads log entries made this request.
  16. *
  17. */
  18. class LogPanel extends DebugPanel {
  19. /**
  20. * Constructor - sets up the log listener.
  21. *
  22. * @return \LogPanel
  23. */
  24. public function __construct() {
  25. parent::__construct();
  26. $existing = CakeLog::configured();
  27. if (empty($existing)) {
  28. CakeLog::config('default', array(
  29. 'engine' => 'FileLog'
  30. ));
  31. }
  32. CakeLog::config('debug_kit_log_panel', array(
  33. 'engine' => 'DebugKit.DebugKitLog',
  34. 'panel' => $this
  35. ));
  36. }
  37. /**
  38. * beforeRender Callback
  39. *
  40. * @param Controller $controller
  41. * @return array
  42. */
  43. public function beforeRender(Controller $controller) {
  44. $logger = $this->logger;
  45. return $logger;
  46. }
  47. }