Download the PHP package webfiori/log without Composer
On this page you can find all versions of the php package webfiori/log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor webfiori
Package log
Short Description A lightweight structured logging library for PHP.
License MIT
Package log
Short Description A lightweight structured logging library for PHP.
License MIT
Please rate this library. Is it a good library?
Informations about the package log
WebFiori Log
A lightweight structured logging library for PHP with daily file rotation and level filtering.
Supported PHP Versions
This library requires PHP 8.1 or higher.
| Build Status |
|---|
Features
- Logger interface — swap implementations without changing application code
- FileLogger — daily-rotated log files with structured format
- Static facade (
LoggerFacade) for quick usage without DI - Level filtering — set minimum level (debug, info, warning, error, critical)
- Structured context — attach key-value metadata to log entries
- Zero dependencies — requires only PHP 8.1+
Installation
Usage
Basic Logging
Output (/var/log/myapp/app-2026-05-29.log):
Static Facade
Custom Logger Implementation
API
Logger (interface)
| Method | Description |
|---|---|
debug(string $message, array $context = []) |
Log debug message |
info(string $message, array $context = []) |
Log informational message |
warning(string $message, array $context = []) |
Log warning message |
error(string $message, array $context = []) |
Log error message |
critical(string $message, array $context = []) |
Log critical message |
log(string $level, string $message, array $context = []) |
Log at specified level |
FileLogger
| Method | Description |
|---|---|
__construct(string $logDir, string $minLevel = 'debug') |
Create logger with directory and minimum level |
getLogDir(): string |
Returns the log directory path |
getMinLevel(): string |
Returns the current minimum level |
setMinLevel(string $level): void |
Change the minimum level at runtime |
LogLevel
| Constant | Value |
|---|---|
LogLevel::DEBUG |
'debug' |
LogLevel::INFO |
'info' |
LogLevel::WARNING |
'warning' |
LogLevel::ERROR |
'error' |
LogLevel::CRITICAL |
'critical' |
LoggerFacade
| Method | Description |
|---|---|
getInstance(): Logger |
Get the default logger |
setInstance(Logger $logger): void |
Replace the default logger |
reset(): void |
Destroy the default instance |
All Logger methods |
Delegates to the default instance |
License
MIT
All versions of log with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package webfiori/log contains the following files
Loading the files please wait ...