Download the PHP package samirmhsnv/laravel-linear-log without Composer
On this page you can find all versions of the php package samirmhsnv/laravel-linear-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samirmhsnv/laravel-linear-log
More information about samirmhsnv/laravel-linear-log
Files in samirmhsnv/laravel-linear-log
Package laravel-linear-log
Short Description Laravel custom logging driver that creates Linear issues from error logs.
License MIT
Informations about the package laravel-linear-log
Laravel Linear Issues
Create Linear issues automatically from Laravel log events using a custom Monolog logging driver.
Installation
Laravel package auto-discovery registers the service provider automatically.
Publish package config (optional, if you want a dedicated config file):
Configuration
The package registers a custom log driver named linear.
Example channel in your app config/logging.php:
Environment Variables
| Key | Required | Description | Example |
|---|---|---|---|
LINEAR_LOG_LEVEL |
No | Minimum log level sent to the linear channel. Use error for production issue creation. |
error |
LINEAR_API_KEY |
Yes | Linear API key used in the Authorization header for GraphQL requests. |
lin_api_xxxxxxxxxxxxx |
LINEAR_TEAM_ID |
Yes | Linear team ID where issues are created. | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
LINEAR_PROJECT_ID |
No | Optional Linear project ID to attach created issues to a specific project. | 1f2e3d4c-5b6a-7890-cdef-1234567890ab |
LINEAR_STATE_ID |
No | Optional 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 |
No | Linear label ID for the Bug badge. Applied automatically for error/critical logs only. |
c0ffee00-1111-2222-3333-444455556666 |
LINEAR_PRIORITY |
No | Optional Linear priority value for created issues. | 2 |
LINEAR_TITLE_PREFIX |
No | Prefix added to issue titles before log details. | Chatasist |
LINEAR_TIMEOUT |
No | HTTP request timeout in seconds for the Linear API request. | 3.0 |
LINEAR_CONNECT_TIMEOUT |
No | HTTP connect timeout in seconds for establishing the Linear API connection. | 1.5 |
Usage
Send logs directly to Linear
Add to stack channel
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
Set your API key first:
Then fetch IDs using these commands.
Get Team ID
Pick your team from key / name, then set:
Get Project ID (Optional)
Set:
Get State ID (Optional)
Set:
Get Bug Label ID (Optional)
Find the label with name = "Bug" and set:
Apply New Env Values
Smoke Test
If you see Invalid scope: read required, create a new Linear API key with read scope (and issue create/write scope).
Behavior Notes
- This handler is intended for
errorand above. - If Linear credentials are missing (
LINEAR_API_KEYorLINEAR_TEAM_ID), the handler safely no-ops. - If
LINEAR_BUG_LABEL_IDis set, theBuglabel is automatically applied forerror/criticallogs. - If the Linear API request fails, exceptions are swallowed to avoid recursive logging failures.
Requirements
- PHP
^8.0 - Laravel log/support components
^8.0to^13.0 monolog/monolog^2.8or^3.0guzzlehttp/guzzle^7.9
License
MIT
All versions of laravel-linear-log with dependencies
illuminate/log Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
monolog/monolog Version ^2.8|^3.0
guzzlehttp/guzzle Version ^7.9