PHPackages                             samirmhsnv/laravel-linear-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. samirmhsnv/laravel-linear-log

ActiveLibrary

samirmhsnv/laravel-linear-log
=============================

Laravel custom logging driver that creates Linear issues from error logs.

v1.0.1(yesterday)024↑2400%MITPHPPHP ^8.0

Since Apr 6Pushed yesterdayCompare

[ Source](https://github.com/samirmhsnv/laravel-linear-log)[ Packagist](https://packagist.org/packages/samirmhsnv/laravel-linear-log)[ RSS](/packages/samirmhsnv-laravel-linear-log/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (3)Used By (0)

Laravel Linear Issues
=====================

[](#laravel-linear-issues)

Create Linear issues automatically from Laravel log events using a custom Monolog logging driver.

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

[](#installation)

```
composer require samirmhsnv/laravel-linear-log
```

Laravel package auto-discovery registers the service provider automatically.

Publish package config (optional, if you want a dedicated config file):

```
php artisan vendor:publish --tag=linear-issues-config
```

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

[](#configuration)

The package registers a custom log driver named `linear`.

Example channel in your app `config/logging.php`:

```
'linear' => [
    'driver' => 'linear',
    'level' => env('LINEAR_LOG_LEVEL', 'error'),
    'api_key' => env('LINEAR_API_KEY'),
    'team_id' => env('LINEAR_TEAM_ID'),
    'project_id' => env('LINEAR_PROJECT_ID'),
    'state_id' => env('LINEAR_STATE_ID'),
    'bug_label_id' => env('LINEAR_BUG_LABEL_ID'),
    'priority' => env('LINEAR_PRIORITY'),
    'title_prefix' => env('LINEAR_TITLE_PREFIX', env('APP_NAME', 'Laravel')),
    'timeout' => env('LINEAR_TIMEOUT', 3.0),
    'connect_timeout' => env('LINEAR_CONNECT_TIMEOUT', 1.5),
],
```

Environment Variables
---------------------

[](#environment-variables)

KeyRequiredDescriptionExample`LINEAR_LOG_LEVEL`NoMinimum log level sent to the `linear` channel. Use `error` for production issue creation.`error``LINEAR_API_KEY`YesLinear API key used in the `Authorization` header for GraphQL requests.`lin_api_xxxxxxxxxxxxx``LINEAR_TEAM_ID`YesLinear team ID where issues are created.`a1b2c3d4-e5f6-7890-abcd-ef1234567890``LINEAR_PROJECT_ID`NoOptional Linear project ID to attach created issues to a specific project.`1f2e3d4c-5b6a-7890-cdef-1234567890ab``LINEAR_STATE_ID`NoOptional workflow state ID (e.g. Backlog, Todo). If omitted, Linear uses the team's default initial state.`9a8b7c6d-5e4f-3210-abcd-1234567890ef``LINEAR_BUG_LABEL_ID`NoLinear label ID for the `Bug` badge. Applied automatically for `error`/`critical` logs only.`c0ffee00-1111-2222-3333-444455556666``LINEAR_PRIORITY`NoOptional Linear priority value for created issues.`2``LINEAR_TITLE_PREFIX`NoPrefix added to issue titles before log details.`Chatasist``LINEAR_TIMEOUT`NoHTTP request timeout in seconds for the Linear API request.`3.0``LINEAR_CONNECT_TIMEOUT`NoHTTP connect timeout in seconds for establishing the Linear API connection.`1.5`Usage
-----

[](#usage)

### Send logs directly to Linear

[](#send-logs-directly-to-linear)

```
use Illuminate\Support\Facades\Log;

Log::channel('linear')->error('Payment webhook failed', [
    'order_id' => 1234,
    'provider' => 'stripe',
]);
```

### Add to stack channel

[](#add-to-stack-channel)

```
LOG_STACK=single,linear
```

When used in a stack, Laravel will continue writing to your standard channel(s) while also creating Linear issues for matching log levels.

Setup IDs From Linear API
-------------------------

[](#setup-ids-from-linear-api)

Set your API key first:

```
LINEAR_API_KEY=lin_api_xxxxxxxxxxxxx
```

Then fetch IDs using these commands.

### Get Team ID

[](#get-team-id)

```
php artisan tinker --execute '$apiKey = env("LINEAR_API_KEY"); $query = "query { teams { nodes { id key name } } }"; $response = Illuminate\Support\Facades\Http::withHeaders(["Authorization" => $apiKey, "Content-Type" => "application/json"])->post("https://api.linear.app/graphql", ["query" => $query]); dump($response->json());'
```

Pick your team from `key` / `name`, then set:

```
LINEAR_TEAM_ID=
```

### Get Project ID (Optional)

[](#get-project-id-optional)

```
php artisan tinker --execute '$apiKey = env("LINEAR_API_KEY"); $query = "query { projects { nodes { id name } } }"; $response = Illuminate\Support\Facades\Http::withHeaders(["Authorization" => $apiKey, "Content-Type" => "application/json"])->post("https://api.linear.app/graphql", ["query" => $query]); dump($response->json());'
```

Set:

```
LINEAR_PROJECT_ID=
```

### Get State ID (Optional)

[](#get-state-id-optional)

```
php artisan tinker --execute '$apiKey = env("LINEAR_API_KEY"); $teamId = env("LINEAR_TEAM_ID"); $query = "query { team(id: \"".$teamId."\") { states { nodes { id name type } } } }"; $response = Illuminate\Support\Facades\Http::withHeaders(["Authorization" => $apiKey, "Content-Type" => "application/json"])->post("https://api.linear.app/graphql", ["query" => $query]); dump($response->json());'
```

Set:

```
LINEAR_STATE_ID=
```

### Get Bug Label ID (Optional)

[](#get-bug-label-id-optional)

```
php artisan tinker --execute '$apiKey = env("LINEAR_API_KEY"); $query = "query { issueLabels { nodes { id name } } }"; $response = Illuminate\Support\Facades\Http::withHeaders(["Authorization" => $apiKey, "Content-Type" => "application/json"])->post("https://api.linear.app/graphql", ["query" => $query]); dump($response->json());'
```

Find the label with `name = "Bug"` and set:

```
LINEAR_BUG_LABEL_ID=
```

### Apply New Env Values

[](#apply-new-env-values)

```
php artisan config:clear
```

### Smoke Test

[](#smoke-test)

```
php artisan tinker --execute 'Log::channel("linear")->error("Linear smoke test", ["source" => "readme-setup"]);'
```

If you see `Invalid scope: read required`, create a new Linear API key with read scope (and issue create/write scope).

Behavior Notes
--------------

[](#behavior-notes)

- This handler is intended for `error` and above.
- If Linear credentials are missing (`LINEAR_API_KEY` or `LINEAR_TEAM_ID`), the handler safely no-ops.
- If `LINEAR_BUG_LABEL_ID` is set, the `Bug` label is automatically applied for `error`/`critical` logs.
- If the Linear API request fails, exceptions are swallowed to avoid recursive logging failures.

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

[](#requirements)

- PHP `^8.0`
- Laravel log/support components `^8.0` to `^13.0`
- `monolog/monolog` `^2.8` or `^3.0`
- `guzzlehttp/guzzle` `^7.9`

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance100

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/54883542?v=4)[Samir Mammadhasanov](/maintainers/samirmhsnv)[@samirmhsnv](https://github.com/samirmhsnv)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/samirmhsnv-laravel-linear-log/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.5k](/packages/craftcms-cms)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[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)
