PHPackages                             onramplab/laravel-log-enhancement - 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. onramplab/laravel-log-enhancement

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

onramplab/laravel-log-enhancement
=================================

An enhanced logging package for Laravel

v12.0.2(5mo ago)028.8k—4%1[2 PRs](https://github.com/OnrampLab/laravel-log-enhancement/pulls)MITPHPPHP ^8.2

Since Jan 5Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/OnrampLab/laravel-log-enhancement)[ Packagist](https://packagist.org/packages/onramplab/laravel-log-enhancement)[ RSS](/packages/onramplab-laravel-log-enhancement/feed)WikiDiscussions 12.x Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (28)Used By (0)

laravel-log-enhancement
=======================

[](#laravel-log-enhancement)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![CircleCI](https://camo.githubusercontent.com/47c0a16268eabc519c53429bbc997ad997a41579a763abef0d2b41b4467d50ed/68747470733a2f2f636972636c6563692e636f6d2f67682f4f6e72616d704c61622f6c61726176656c2d6c6f672d656e68616e63656d656e742e7376673f7374796c653d736869656c64)](https://circleci.com/gh/OnrampLab/laravel-log-enhancement)[![Total Downloads](https://camo.githubusercontent.com/a1ae86bef6e3b255024412a660d91e6c132e17fa8759e799df194b2c0a67d7f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6e72616d706c61622f6c61726176656c2d6c6f672d656e68616e63656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/onramplab/laravel-log-enhancement)

A library with logging enhancement. Including:

- Overriding `Log` facade

    - It extends default Laravel `Log` facade with logging adding class path and tracking id into context.
- `LogglyHandler` class

    - It extends monolog's LogglyHandler with tags support
- `DatadogHandler` class

    - It supports Datadog Logs

Install
-------

[](#install)

```
composer require onramplab/laravel-log-enhancement
```

- use Datadog APM to connect php logs and traces

```
curl -LO https://github.com/DataDog/dd-trace-php/releases/latest/download/datadog-setup.php
sudo php datadog-setup.php --php-bin=all
```

Usage
-----

[](#usage)

### LoggerFacade

[](#loggerfacade)

The log json will look like this:

```
{
  "message": "Test",
  "context": {
    "class_path": "App\\Fake",
    "tracking_id": "652c3456-1a17-42b8-9fa7-9bee65e655eb"
  },
  "level": 200,
  "level_name": "INFO",
  "channel": "local",
  "extra": {},
  "timestamp": "2021-01-04T22:47:56.598608-0800"
}
```

### LogglyHandler

[](#logglyhandler)

You can adding following block into `config/logging.php`.

```
use Monolog\Formatter\LogglyFormatter;
use Onramplab\LaravelLogEnhancement\Handlers\LogglyHandler;

return [
  //...

  'channels' => [
    //...

    'loggly' => [
        'driver' => 'monolog',
        'level' => 'info',
        'handler' => LogglyHandler::class,
        'handler_with' => [
            'token' => env('LOGGLY_TOKEN'),
            'tags' => env('LOGGLY_TAGS'),
        ],
        'formatter' => LogglyFormatter::class,
    ],
  ]
];
```

### DatadogHandler

[](#datadoghandler)

You can adding following block into `config/logging.php`.

```
use Monolog\Formatter\JsonFormatter;
use Onramplab\LaravelLogEnhancement\Handlers\DatadogHandler;

return [
  //...

  'channels' => [
    //...

    'datadog' => [
      'driver' => 'monolog',
      'level' => 'info',
      'handler' => DatadogHandler::class,
      'handler_with' => [
          'key' => env('DD_LOG_API_KEY'),
          'region' => env('DD_LOG_REGION', 'us5'),
          'attributes' => [
              'hostname' => gethostname(),
              'source' => env('DD_LOG_SOURCE', 'laravel'),
              'service' => env('DD_LOG_SERVICE'),
              'tags' => env('DD_LOG_TAG'),
          ],
      ],
      'formatter' => JsonFormatter::class,
    ],
  ]
];
```

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](/LICENSE.md) for more information.# laravel-log-enhancement

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance80

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% 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 ~82 days

Recently: every ~206 days

Total

23

Last Release

161d ago

Major Versions

v1.1.0 → 7.0.x-dev2022-06-24

v7.0.0 → v8.0.02022-06-24

v8.1.0 → v10.0.02023-09-01

10.x-dev → 11.x-dev2023-09-06

v8.1.1 → v12.0.02025-12-09

PHP version history (4 changes)v7.0.0PHP &gt;=7.2

v8.0.0PHP &gt;=7.3

10.x-devPHP &gt;=8.1

v12.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![koshuang](https://avatars.githubusercontent.com/u/1978357?v=4)](https://github.com/koshuang "koshuang (52 commits)")[![musigm](https://avatars.githubusercontent.com/u/43640987?v=4)](https://github.com/musigm "musigm (10 commits)")[![chenghung](https://avatars.githubusercontent.com/u/3082432?v=4)](https://github.com/chenghung "chenghung (2 commits)")

---

Tags

laravel-loglogglyloggly-client

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/onramplab-laravel-log-enhancement/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2332.0M2](/packages/inspector-apm-inspector-laravel)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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