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

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

monkeyscloud/monkeyslegion-logger
=================================

Advanced logger for the MonkeysLegion PHP framework.

1.0.2(5mo ago)1897↑142.9%6MITPHPPHP ^8.4

Since Nov 19Pushed 3mo agoCompare

[ Source](https://github.com/MonkeysCloud/MonkeysLegion-Logger)[ Packagist](https://packagist.org/packages/monkeyscloud/monkeyslegion-logger)[ RSS](/packages/monkeyscloud-monkeyslegion-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (6)

MonkeysLegion Log
=================

[](#monkeyslegion-log)

A flexible, PSR-3 compliant PHP logging library with environment-aware logging, multiple drivers, and extensive configuration options.

[![PHP Version](https://camo.githubusercontent.com/9c2f8ad80d34105266a94c4c06234f8ed18c968d3595039c2d9a7becd1e71c8b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Features
--------

[](#features)

- 🎯 **PSR-3 Compliant** - Implements PSR-3 LoggerInterface
- 🌍 **Environment-Aware Logging** - Smart logging based on environment
- 🔌 **Multiple Drivers** - File, Console, Syslog, Error Log, Null, and Stack
- 🎨 **Colorized Console Output** - Beautiful colored terminal logs
- 📊 **Log Level Filtering** - Control what gets logged
- 🎭 **Custom Formatting** - Flexible message formatting
- 📚 **Stack Logger** - Combine multiple loggers
- 📅 **Daily Rotation** - Automatic date-based log file rotation
- 🔄 **Circular Dependency Detection** - Prevents infinite loops
- 🧪 **Fully Tested** - Comprehensive test coverage
- 💪 **Type-Safe** - Full PHPStan level max compliance

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

[](#installation)

```
composer require monkeyscloud/monkeyslegion-logger
```

Quick Start
-----------

[](#quick-start)

```
use MonkeysLegion\Logger\Factory\LoggerFactory;

// Load configuration
$config = require 'config/logging.php';

// Create logger factory
$factory = new LoggerFactory($config, 'production');

// Get default logger
$logger = $factory->make();

// Start logging
$logger->info('Application started', ['user_id' => 123]);
$logger->error('Database connection failed', ['error' => $e->getMessage()]);
```

Configuration
-------------

[](#configuration)

Create a configuration file (e.g., `config/logging.php`):

```
