log4php generates a Deprecated: fwrite(): Passing null to parameter #2 ($data) of type string is deprecated in D:\inc\log4php\appenders\LoggerAppenderFile.php on line 137
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://logging.apache.org/log4php/">
<appender name="default" class="LoggerAppenderFile">
<layout class="LoggerLayoutSimple" />
<param name="file" value="test.log" />
<param name="append" value="true" />
</appender>
<root>
<appender_ref ref="default" />
</root>
</configuration>
and initialization
require ROOT . "/inc/log4php/Logger.php";
Logger::configure( ROOT . 'log-config.xml' );
$logger = Logger::getLogger( 'main' );
define( 'LOG', $logger );
LOG->debug( 'utils.php' );
What would be the proper way to start the log4php logger? I copied the settings from the documentation.
The official log4php project is now old and inactive, but there exists a fork that added PHP 8 compatibility (as you can see here):