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

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

elementary/logger-trait
=======================

Extend \\Psr\\Log\\LoggerAwareTrait

1.0.3(8y ago)12152MITPHPPHP &gt;=5.6

Since Mar 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/php-elementary/logger-trait)[ Packagist](https://packagist.org/packages/elementary/logger-trait)[ RSS](/packages/elementary-logger-trait/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (2)

Extention of \\Psr\\Log\\LoggerAwareTrait
=========================================

[](#extention-of-psrlogloggerawaretrait)

The trait `LogerTrait` extends `LoggerAwareTrait` with one method `getLoger()`.

[![Latest Stable Version](https://camo.githubusercontent.com/d20de4c104b3dd3f3db6708d2b8dfe60fdcb947250be9f9b3b9307045d0e0b17/68747470733a2f2f706f7365722e707567782e6f72672f656c656d656e746172792f6c6f676765722d74726169742f762f737461626c65)](https://packagist.org/packages/elementary/logger-trait)[![License](https://camo.githubusercontent.com/53b1a2f031d4ab77b34b9901066d4d5fb0aa423cd859638b6a736f7a9a788ca3/68747470733a2f2f706f7365722e707567782e6f72672f656c656d656e746172792f6c6f676765722d74726169742f6c6963656e7365)](https://packagist.org/packages/elementary/logger-trait)[![Build Status](https://camo.githubusercontent.com/a177429a352ae4464c82fb7ce0c2398ee130eadd50696aa1dcc1ad05eadc793c/68747470733a2f2f7472617669732d63692e6f72672f7068702d656c656d656e746172792f6c6f676765722d74726169742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-elementary/logger-trait)[![Coverage Status](https://camo.githubusercontent.com/333f8a189b8b9cf655d5deb91810b7b4220a9b1f1b2ee3f10874a00e71d29b11/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7068702d656c656d656e746172792f6c6f676765722d74726169742f62616467652e737667)](https://coveralls.io/github/php-elementary/logger-trait)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/) and then run

```
composer require elementary/logger-trait

```

Usage
-----

[](#usage)

```
use elementary\logger\traits\LoggerGetInterface;
use elementary\logger\traits\LoggerTrait;
use Psr\Log\LoggerAwareInterface;

class Example implements LoggerGetInterface, LoggerAwareInterface
{
    use LoggerTrait;

    public function doSomeThing()
    {
        // do some thing
        $this->getLogger()->info('do some thing');
    }
}

$ex = new Example();

// In this case, the message will be sent to `\Psr\Log\NullLogger`
$ex->doSomeThing();

// Now message will be send to Graylog
$ex->setLogger(new \Gelf\Logger($publisher, $facility));
$ex->doSomeThing();
```

Testing and Code coverage
-------------------------

[](#testing-and-code-coverage)

Unit Tests are located in tests directory. You can run your tests and collect coverage with the following command:

```
vendor/bin/phpunit

```

Result of coverage will be output into the `tests/output` directory.

License
-------

[](#license)

For license information check the [LICENSE](LICENSE)-file.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~1 days

Total

4

Last Release

2979d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/797553ab4740e78d80571f66be4bf6a5fcfccc620a6daa4943f3d25635c9d971?d=identicon)[elementary](/maintainers/elementary)

---

Top Contributors

[![vendelev](https://avatars.githubusercontent.com/u/9020408?v=4)](https://github.com/vendelev "vendelev (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elementary-logger-trait/health.svg)

```
[![Health](https://phpackages.com/badges/elementary-logger-trait/health.svg)](https://phpackages.com/packages/elementary-logger-trait)
```

###  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/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[open-telemetry/api

API for OpenTelemetry PHP.

1833.0M214](/packages/open-telemetry-api)[pagemachine/typo3-formlog

Form log for TYPO3

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

PHPackages © 2026

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