Guest User

Untitled

a guest
Oct 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2. ini_set('error_reporting', E_ALL);
  3. ini_set('display_errors', 1);
  4.  
  5. echo "Testing loging! - 5";
  6.  
  7. require 'log4php/Logger.php';
  8. Logger::configure('log4php.xml');
  9.  
  10. class Elder
  11. {
  12.     protected $log;
  13.    
  14.     public function __construct()
  15.     {
  16.         $this->log = Logger::getLogger('myLogger');
  17.         echo "<pre>";
  18.         var_dump($this->log);
  19.         echo "</pre>";
  20.     }
  21.    
  22.     public function logSomething()
  23.     {
  24.         $this->log->info("From within");
  25.     }
  26.  
  27. }
  28.  
  29. class Youth extends Elder
  30. {
  31.     public function doSomething()
  32.     {
  33.         $this->logSomething();
  34.     }
  35.  
  36. }
  37.  
  38.  
  39. $y = new Youth();
  40. $y->doSomething();
  41.  
  42.  
  43. ?>
Add Comment
Please, Sign In to add comment