PHPackages                             mb4it/logger - 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. mb4it/logger

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

mb4it/logger
============

File-based PSR-3 logger with channel support.

06PHP

Since Feb 20Pushed 2mo agoCompare

[ Source](https://github.com/Dictator90/mb-logger)[ Packagist](https://packagist.org/packages/mb4it/logger)[ RSS](/packages/mb4it-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MB Logger
=========

[](#mb-logger)

PSR-3 compatible file logger with channel support (subdirectories), filename patterns, and filesystem abstraction via `mb4it/filesystem`.

Installation
------------

[](#installation)

```
composer require mb4it/logger
```

Requirements:

- PHP 8.1+
- `psr/log` ^3.0
- `mb4it/filesystem` ^1.0

Overview
--------

[](#overview)

- **Log path** is set when creating the logger (`basePath`).
- **Channel** (`channel('payments')`) is a logger that writes to a subdirectory or set of files under `basePath`.
- File operations use `mb4it/filesystem`.
- The logger implements `Psr\Log\LoggerInterface` (via `Psr\Log\AbstractLogger`).

---

Basic usage (single `app.log` file)
-----------------------------------

[](#basic-usage-single-applog-file)

```
