PHPackages                             switon/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. switon/log

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

switon/log
==========

PSR-3 logging with automatic categories, structured context, and category-aware level filtering for Switon Framework

v1.0.0(1mo ago)073MITPHPPHP &gt;=8.3CI passing

Since Jun 6Pushed 2mo agoCompare

[ Source](https://github.com/switon-php/log)[ Packagist](https://packagist.org/packages/switon/log)[ Docs](https://github.com/switon-php/log)[ RSS](/packages/switon-log/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (2)Used By (3)

Switon Log Package
==================

[](#switon-log-package)

[![Log CI](https://camo.githubusercontent.com/f5b3870dcc4a2c4334b50ad54a296f267a81a9e2af3ea92c2c715c8ddf6f4c2e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769746f6e2d7068702f6c6f672f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4c6f672532304349)](https://github.com/switon-php/log/actions/workflows/ci.yml) [![PHP 8.3+](https://camo.githubusercontent.com/c03f51341eebaefabbf137e291b20523fc74b4ffd084406d88524d266d95085d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d373737424234)](https://www.php.net/)

Switon's PSR-3 logger for application services that want automatic categories, structured context, per-category filtering, and low-setup defaults.

Highlights
----------

[](#highlights)

- **Standard logger contract:** `LoggerInterface` is the main logging contract.
- **Automatic category routing:** log categories can be derived from the caller.
- **Structured context:** placeholder interpolation and extra context stay structured.
- **Output backends:** stdout, file, syslog, and memory sinks are available.
- **Category-aware filtering:** `Logger` derives categories from the caller and applies per-category levels.

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

[](#installation)

```
composer require switon/log
```

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

[](#quick-start)

```
use Psr\Log\LoggerInterface;
use Switon\Core\Attribute\Autowired;

class UserService
{
    #[Autowired] protected LoggerInterface $logger;

    public function login(int $userId): void
    {
        $this->logger->info('User logged in', ['user_id' => $userId]);
    }
}
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance87

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc0f20ad15b0ae9fbf9c6e2cd3008692b0c88a877ec8d3e0119211314bf86fc8?d=identicon)[switon](/maintainers/switon)

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (6 commits)")

---

Tags

loggingobservabilitypsr-3switonpsr-3loggingobservabilityswiton

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/mailer

Helps sending emails

1.6k409.1M1.5k](/packages/symfony-mailer)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

12510.5M141](/packages/web-auth-webauthn-lib)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)

PHPackages © 2026

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