Example 35-1.
In the following example code, all log messages are written into the file user.log.
<?php require_once 'Log.php'; $conf = array('mode' => 0600, 'timeFormat' => '%X %x'); $log = &Log::singleton('file', '/tmp/user.log', 'test1', $conf, LOG_INFO); for ($i = 0; $i < 12; $i++) { $log->log("Foo: $i", LOG_INFO); } $log->close(); ?>