PHPackages                             devtime-ltd/laravel-axiom-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. devtime-ltd/laravel-axiom-log

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

devtime-ltd/laravel-axiom-log
=============================

Batched Monolog handler for Axiom in Laravel.

v0.7.1(2mo ago)12.7k↓50.9%[1 PRs](https://github.com/devtime-ltd/laravel-axiom-log/pulls)MITPHPPHP ^8.2CI passing

Since Apr 10Pushed 1mo agoCompare

[ Source](https://github.com/devtime-ltd/laravel-axiom-log)[ Packagist](https://packagist.org/packages/devtime-ltd/laravel-axiom-log)[ RSS](/packages/devtime-ltd-laravel-axiom-log/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (12)Used By (0)

Laravel Axiom Log
=================

[](#laravel-axiom-log)

Batched log handler for [Axiom](https://axiom.co) in Laravel. Buffers log records in memory and flushes them as a single POST to Axiom's ingest API at end of request (or when batch size threshold is reached).

> **Looking for request logging?** The request-logging middleware (now `RequestSensor`) moved to [devtime-ltd/laravel-observability-log](https://github.com/devtime-ltd/laravel-observability-log) as of v0.4.0. It is provider-agnostic and works alongside this handler, Better Stack, stderr, or any other Laravel log channel.

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

[](#installation)

```
composer require devtime-ltd/laravel-axiom-log
```

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

[](#configuration)

Add a log channel to your `config/logging.php`:

```
'axiom' => [
    'driver' => 'monolog',
    'level' => env('LOG_LEVEL', 'debug'),
    'handler' => \DevtimeLtd\LaravelAxiomLog\AxiomHandler::class,
    'handler_with' => [
        'apiToken' => env('AXIOM_LOG_TOKEN'),
        'dataset'  => env('AXIOM_LOG_DATASET'),
    ],
    'processors' => [PsrLogMessageProcessor::class],
],
```

`host` (default: `https://api.axiom.co`), `batchSize` (default: `50`), `timeout` (default: `5` seconds, applied to ingest cURL calls) and `shutdownTimeout` (default: `2` seconds, applied when flushing during PHP shutdown so an Axiom outage cannot stall the request) can be added to `handler_with` if you need non-default values.

Then add `axiom` to your `LOG_STACK`, or use it directly:

```
Log::channel('axiom')->info('something happened', ['key' => 'value']);
```

Need multiple Axiom channels with different datasets? Just define more entries:

```
'axiom-requests' => [
    'driver' => 'monolog',
    'level' => env('LOG_LEVEL', 'debug'),
    'handler' => \DevtimeLtd\LaravelAxiomLog\AxiomHandler::class,
    'handler_with' => [
        'apiToken' => env('AXIOM_LOG_TOKEN'),
        'dataset'  => 'acme_requests_log',
    ],
    'processors' => [PsrLogMessageProcessor::class],
],
'axiom-activity' => [
    'driver' => 'monolog',
    'level' => env('LOG_LEVEL', 'debug'),
    'handler' => \DevtimeLtd\LaravelAxiomLog\AxiomHandler::class,
    'handler_with' => [
        'apiToken' => env('AXIOM_LOG_TOKEN'),
        'dataset'  => 'acme_activity_log',
    ],
    'processors' => [PsrLogMessageProcessor::class],
],
```

When records are sent
---------------------

[](#when-records-are-sent)

Records are buffered and flushed in any of the following situations:

- The buffer reaches `batchSize` (default 50).
- The handler is destructed at end of a synchronous request (PHP shutdown).
- A queue worker finishes a job (`JobProcessed`, `JobExceptionOccurred`) or stops (`WorkerStopping`).
- An Octane request, task, or tick terminates (auto-detected if `laravel/octane` is installed).

The queue and Octane hooks are registered automatically by `LaravelAxiomLogServiceProvider` (auto-discovered — no manual setup needed). If you have another long-lived process boundary (custom long-running command, scheduled job, etc.) where you want to flush eagerly, call `$handler->flush()` directly or hook into your own event.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance89

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.7% 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 ~2 days

Total

10

Last Release

84d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/933275?v=4)[Alun Davey](/maintainers/4lun)[@4lun](https://github.com/4lun)

---

Top Contributors

[![4lun](https://avatars.githubusercontent.com/u/933275?v=4)](https://github.com/4lun "4lun (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelloggingmonologaxiom

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/devtime-ltd-laravel-axiom-log/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.2k](/packages/craftcms-cms)[illuminate/log

The Illuminate Log package.

6225.3M647](/packages/illuminate-log)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10923.3k](/packages/naoray-laravel-github-monolog)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

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

PHPackages © 2026

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