PHPackages                             codeldev/laravel-job-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. codeldev/laravel-job-log

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

codeldev/laravel-job-log
========================

A simple Laravel package that automatically logs all jobs queued and processed by your application to the database.

1.0.0(1mo ago)014↓100%[1 PRs](https://github.com/codeldev/laravel-job-log/pulls)MITPHPPHP ^8.4CI failing

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/codeldev/laravel-job-log)[ Packagist](https://packagist.org/packages/codeldev/laravel-job-log)[ Docs](https://github.com/codeldev/laravel-job-log)[ GitHub Sponsors](https://github.com/CodelDev)[ RSS](/packages/codeldev-laravel-job-log/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (17)Versions (4)Used By (0)

Laravel Job Log
===============

[](#laravel-job-log)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fdd6ee6c341820a786fcd47675324b4ba72436058d7cb156ea00213360792f2e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656c6465762f6c61726176656c2d6a6f622d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeldev/laravel-job-log)[![GitHub Tests Action Status](https://camo.githubusercontent.com/46af35f1dd15ff199429109ecf7daf27656d11b34b636724ea319b69fc7f2d0e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f64656c6465762f6c61726176656c2d6a6f622d6c6f672f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/codeldev/laravel-job-log/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a0a588a54d9c603dc87de61b2d2c74f38c2d2eb8a59c39f5c4aa406fb8f39426/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f64656c6465762f6c61726176656c2d6a6f622d6c6f672f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/codeldev/laravel-job-log/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/ed0ea6e7bd9584a2b75588e2285c7280fb9104843cdd48e0a7b8caa1913f7765/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656c6465762f6c61726176656c2d6a6f622d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeldev/laravel-job-log)

A simple Laravel package that automatically logs all jobs queued and processed by your application to the database. It listens to Laravel's built-in Job Events to record information without wrapping or modifying the Queue itself. Ships with configurable table names, a swappable Eloquent model, and a built-in prune command to manage retention.

---

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 13+

---

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

[](#installation)

You can install the package via composer:

```
composer require codeldev/laravel-job-log
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="job-log-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="job-log-config"
```

This is the contents of the published config file:

```
return [
    'prune_days' => (int) env('JOB_LOG_PRUNE_DAYS', 365),
    'model' => CodelDev\LaravelJobLog\Models\LaravelJobLog::class,
    'table' => env('JOB_LOG_TABLE', 'job_log'),
];
```

### Environment Variables

[](#environment-variables)

The following env variables are available to configure the package using your env file.

```
JOB_LOG_PRUNE_DAYS=365
JOB_LOG_TABLE=job_log
```

---

Usage
-----

[](#usage)

Once installed, the package automatically logs every job. No additional setup is required.

### Pruning Old Records

[](#pruning-old-records)

Add to your `routes/console.php` file:

```
Schedule::command('job-log:prune')
    ->weeklyOn(1, '02:30')
    ->withoutOverlapping();
```

Run manually:

```
php artisan job-log:prune
```

---

Querying the Data
-----------------

[](#querying-the-data)

The package provides an Eloquent model you can use directly:

```
use CodelDev\LaravelJobLog\Models\LaravelJobLog;
use CodelDev\LaravelJobLog\Enums\LaravelJobRunStatusEnum;

// Get all logs
LaravelJobLog::all();

// Filter by status
LaravelJobLog::query()
->where('status', LaravelJobRunStatusEnum::SUCCEEDED)
->get();

LaravelJobLog::query()
->where('status', LaravelJobRunStatusEnum::FAILED)
->get();

LaravelJobLog::query()
->where('status', LaravelJobRunStatusEnum::RUNNING)
->get();

// Filter by job class
LaravelJobLog::query()
    ->where('job', 'App\\Jobs\\MyJob')
    ->get();

// Filter by queue
LaravelJobLog::query()
    ->where('queue', 'default')
    ->get();

// Jobs from the last 24 hours
LaravelJobLog::query()
    ->where('started_at', '>=', now()->subDay())
    ->get();

// Slow jobs (over 1 second)
LaravelJobLog::query()
    ->where('duration_ms', '>', 1000)
    ->orderBy('duration_ms', 'desc')
    ->get();

// Failed jobs with exception details
LaravelJobLog::query()
    ->where('status', LaravelJobRunStatusEnum::FAILED)
    ->with('failedJob')
    ->get();

// Paginate results
LaravelJobLog::query()
    ->orderBy('created_at', 'desc')
    ->paginate(15);
```

---

### Available Fields

[](#available-fields)

**LaravelJobLog**

FieldTypeDescription`id``string`UUID primary key`job_uuid``string|null`Laravel's internal job UUID`job``string`Fully qualified job class name`queue``string`Queue name (e.g. `default`)`attempt``int`Attempt number`started_at``CarbonImmutable`When the job started processing`completed_at``CarbonImmutable|null`When the job finished`status``LaravelJobRunStatusEnum``RUNNING` (1), `SUCCEEDED` (2), or `FAILED` (3)`duration_ms``int|null`Execution time in milliseconds`failed_job_id``int|null`Foreign key to Laravel's `failed_jobs` table`created_at``CarbonImmutable|null`Record creation timestamp`updated_at``CarbonImmutable|null`Record update timestamp**LaravelJobFailed** (read-only view of Laravel's `failed_jobs` table)

FieldTypeDescription`id``int`Auto-incrementing primary key`uuid``string`Job UUID`connection``string`Queue connection name`queue``string`Queue name`payload``string`Serialized job payload`exception``string`Exception message and stack trace`failed_at``CarbonImmutable`When the job failedThe `LaravelJobLog` model has a `failedJob()` relationship that links to `LaravelJobFailed` via the `failed_job_id` column, giving you access to the full exception details for failed jobs.

---

Using a Custom Model
--------------------

[](#using-a-custom-model)

You can extend the package model to add your own behaviour, scopes, or relationships. Create your custom model, extend the package model, then update the config:

```
use CodelDev\LaravelJobLog\Models\LaravelJobLog as BaseJobLog;

class JobLog extends BaseJobLog
{
    public function scopeFailed($query)
    {
        return $query->where('status', LaravelJobRunStatusEnum::FAILED);
    }
}
```

Then in `config/job-log.php`:

```
'model' => \App\Models\JobLog::class,
```

---

Testing
-------

[](#testing)

```
composer test
```

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

---

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

[](#contributing)

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

---

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

---

Credits
-------

[](#credits)

- [CodelDev](https://github.com/CodelDev)

---

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

57d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/179911763?v=4)[CodelDev](/maintainers/CodelDev)[@codeldev](https://github.com/codeldev)

---

Top Contributors

[![codeldev](https://avatars.githubusercontent.com/u/179911763?v=4)](https://github.com/codeldev "codeldev (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelcodeldevlaravel-job-log

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codeldev-laravel-job-log/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M41](/packages/spatie-laravel-pdf)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

162476.0k](/packages/keepsuit-laravel-opentelemetry)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[spatie/laravel-error-share

Share your Laravel errors to Flare

421.3M5](/packages/spatie-laravel-error-share)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24655.3k](/packages/vormkracht10-laravel-mails)

PHPackages © 2026

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