Guest User

Untitled

a guest
Jun 8th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. require 'logging-log4php/src/main/php/Logger.php ';
  5.  
  6. Logger::configure(array(
  7.     'appenders' => array(
  8.         'default' => array(
  9.             'class' => 'LoggerAppenderRollingFile',
  10.             'layout' => array(
  11.                 'class' => 'LoggerLayoutSimple',
  12.             ),
  13.             'params' => array(
  14.                 'file' => 'log/file.log',
  15.                 'maxFileSize' => '1MB',
  16.                 'maxBackupIndex' => 5,
  17.             ),
  18.         ),
  19.     ),
  20.     'rootLogger' => array(
  21.         'appenders' => array('default'),
  22.     ),
  23. ));
  24.  
  25. $log = Logger::getLogger('foo');
  26. for($i=0;$i<100;$i++)
  27.     $log->info("Bla");
Advertisement
Add Comment
Please, Sign In to add comment