Download the PHP package simova-core/log4php without Composer
On this page you can find all versions of the php package simova-core/log4php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download simova-core/log4php
More information about simova-core/log4php
Files in simova-core/log4php
Package log4php
Short Description A versatile logging framework for PHP. Forked from apache/log4php
License Apache-2.0
Homepage https://logging.apache.org/log4php/
Informations about the package log4php
Log4php (Simova)
A versatile logging framework for PHP, forked from Apache log4php (which is no longer maintained). This fork modernizes the library to run cleanly on PHP 8.3, removes deprecated constructs, fixes compatibility bugs, and adds performance options for use in larger applications.
Requirements
- PHP
^8.3 - Extensions:
ext-libxml,ext-simplexml,ext-pdo - Optional (only for the MongoDB appender):
ext-mongodband themongodb/mongodblibrary^2.0
Installation
The MongoDB appender is optional. If you use it, also install:
Basic usage
Without explicit configuration, log4php uses a default configuration (echo appender, DEBUG level). You can configure it with an array, or an XML/INI/PHP file:
Appenders
The bundled appenders include: Console, Echo, File, DailyFile, RollingFile, Mail,
MailEvent, Null, Php, PDO, Socket, Syslog, FirePHP and MongoDB.
File appender performance options
For high-volume logging in larger projects, LoggerAppenderFile (and its subclasses
LoggerAppenderDailyFile and LoggerAppenderRollingFile) support two options:
bufferSize(int, default0) - Number of messages to accumulate before flushing to disk.0keeps the legacy behavior (immediate write). Values greater than0reduce the number of I/O syscalls and lock acquisitions, which improves throughput. The buffer is flushed onclose()and on the object destructor.locking(bool, defaulttrue) - Whether to lock the file (flock) before each write. Disable it when concurrent access is not a concern to gain performance.
MongoDB appender
The MongoDB appender was rewritten to use the modern mongodb/mongodb library (^2.0) and the
ext-mongodb driver. Authentication is handled through the connection URI options.
Configurable parameters: host, port, databaseName, collectionName, userName, password,
timeout (in milliseconds).
Running the tests
Install the dev dependencies and run PHPUnit:
The test suite targets PHPUnit ^10.5 || ^11.0. Tests are grouped and can be run individually:
MongoDB appender tests are skipped automatically when ext-mongodb / mongodb/mongodb are not
available.
Documentation
The original Apache log4php documentation still applies to most of the API: http://logging.apache.org/log4php/
See CHANGELOG for the changes introduced by this fork.
License
Apache License, Version 2.0.
All versions of log4php with dependencies
ext-libxml Version *
ext-simplexml Version *
mongodb/mongodb Version ^2.0.0
ext-mongodb Version *
ext-pdo Version *