Download the PHP package jidaikobo/log without Composer
On this page you can find all versions of the php package jidaikobo/log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jidaikobo/log
More information about jidaikobo/log
Files in jidaikobo/log
Package log
Short Description A simple logging class with error and exception handling. adheres to PSR-1, PSR-12 and PSR-3.
License MIT
Informations about the package log
jidaikobo/log
[!WARNING] This package is no longer maintained. New projects should not depend on it. No replacement package is designated. Existing releases and source code will remain available for projects that still depend on them.
jidaikobo/log is a simple and flexible logging utility that adheres to the PSR-3 (Logger Interface) standard. It provides both instance-based and static methods for logging, making it easy to integrate into any PHP project.
This package was developed to simplify logging in small-scale projects, such as those using the Slim Framework. It also fulfills the need to log arrays efficiently, which can be crucial for debugging.
Features
- PSR-3 compliant: Supports all standard logging levels.
- Instance-based design: Fully compatible with dependency injection and modern PHP practices.
- Static wrapper: Offers convenient static methods for quick and simple logging.
- Log file rotation: Automatically rotates log files when they reach a specified size.
- Error and exception handling: Integrates with PHP error and exception handling mechanisms.
Installation
Install the package via Composer:
Usage
Basic Initialization
Initialize the logger with a custom log file path and maximum file size (optional):
If Log::init() is not explicitly called, the logger will use default settings.
Logging Messages
Log messages at various levels using static methods:
To output an array:
Error and Exception Handling
Register the logger to handle PHP errors and uncaught exceptions:
Requirements
- PHP >= 7.4
License
This project is licensed under the MIT License, see the LICENSE file for details

