PHPackages                             jidaikobo/log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. jidaikobo/log

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

jidaikobo/log
=============

A simple logging class with error and exception handling. adheres to PSR-1, PSR-12 and PSR-3.

v2.0.8(1y ago)01622MITPHPPHP &gt;=7.4CI passing

Since Dec 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jidaikobo-shibata/log)[ Packagist](https://packagist.org/packages/jidaikobo/log)[ RSS](/packages/jidaikobo-log/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (14)Used By (2)

[![MIT](https://camo.githubusercontent.com/6ba5badddc53f3e9340ce1e9090d761422f770b2b8cf142cefe3b5cb25efe54d/68747470733a2f2f637573746f6d2d69636f6e2d6261646765732e6865726f6b756170702e636f6d2f62616467652f6c6963656e73652d4d49542d3842423830412e7376673f6c6f676f3d6c6177266c6f676f436f6c6f723d7768697465)](https://github.com/jidaikobo-shibata/log/tree/main?tab=MIT-1-ov-file) [![Build Status](https://camo.githubusercontent.com/ce7360d15894363c4de7f1cc81a8dc8dd6c3448531331d2912a944dec2c33c80/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a696461696b6f626f2d736869626174612f6c6f672f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/jidaikobo-shibata/log/build-status/main) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/e6be4d4c89e66a0045a13588d3853dc8b993139613f22d7ccbcf099bbb216804/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a696461696b6f626f2d736869626174612f6c6f672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/jidaikobo-shibata/log/?branch=main)

jidaikobo/log
=============

[](#jidaikobolog)

`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
--------

[](#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
------------

[](#installation)

Install the package via Composer:

```
composer require jidaikobo/log
```

Usage
-----

[](#usage)

### Basic Initialization

[](#basic-initialization)

Initialize the logger with a custom log file path and maximum file size (optional):

```
use Jidaikobo\Log;
Log::init('/path/to/log.log', 5 * 1024 * 1024); // 5MB max file size
```

If Log::init() is not explicitly called, the logger will use default settings.

### Logging Messages

[](#logging-messages)

Log messages at various levels using static methods:

```
Log::info('This is an informational message.');
Log::warning('This is a warning message.');
Log::error('An error occurred.');
Log::debug('Debugging details.');
```

To output an array:

```
Log::write(['foo', 'bar', 'baz']);
```

### Error and Exception Handling

[](#error-and-exception-handling)

Register the logger to handle PHP errors and uncaught exceptions:

```
Log::getInstance()->registerHandlers();
```

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4

License
-------

[](#license)

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT), see the [LICENSE file](https://github.com/jidaikobo-shibata/log/tree/main?tab=MIT-1-ov-file) for details

Author
------

[](#author)

- [jidaikobo-shibata](https://github.com/jidaikobo-shibata/)

Link
----

[](#link)

- [PSR-3: Logger Interface](https://www.php-fig.org/psr/psr-3/)
- [jidaikobo/log - Packagist](https://packagist.org/packages/jidaikobo/log)
- [jidaikobo-shibata/log - GitHub](https://github.com/jidaikobo-shibata/log)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance44

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~0 days

Total

13

Last Release

450d ago

Major Versions

v1.0.3 → v2.0.02024-12-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c4101fe06f917cfc6b6a06df8b09a612b80542833a31c4993a39b452783c50f?d=identicon)[jidaikobo](/maintainers/jidaikobo)

---

Top Contributors

[![jidaikobo-shibata](https://avatars.githubusercontent.com/u/9050388?v=4)](https://github.com/jidaikobo-shibata "jidaikobo-shibata (61 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (7 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jidaikobo-log/health.svg)

```
[![Health](https://phpackages.com/badges/jidaikobo-log/health.svg)](https://phpackages.com/packages/jidaikobo-log)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[open-telemetry/api

API for OpenTelemetry PHP.

1933.0M214](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2322.9M248](/packages/open-telemetry-sdk)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
