Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.220.89.112
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : file.phpt
--TEST--
Log: File Handler
--INI--
date.timezone=UTC
--FILE--
<?php

require_once 'Log.php';

$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test.log';
if (file_exists($filename)) unlink($filename);

/* Write some entries to the log file. */
$conf = array('lineFormat' => '%2$s [%3$s] %4$s');
$logger = Log::singleton('file', $filename, '', $conf);

for ($i = 0; $i < 3; $i++) {
    $logger->log("Log entry $i");
}
$logger->close();

/* Dump the contents of the log file. */
echo file_get_contents($filename);

/* Clean up. */
if (file_exists($filename)) unlink($filename);

--EXPECT--
 [info] Log entry 0
 [info] Log entry 1
 [info] Log entry 2
© 2025 GrazzMean