You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Laravel package that automatically creates GitHub issues from your application logs. Perfect for smaller projects where full-featured logging services like Sentry or Bugsnag might be overkill, but you still want to track bugs effectively.
8
+
Automatically create GitHub issues from your Laravel logs. Perfect for smaller projects without the need for full-featured logging services.
9
9
10
10
## Requirements
11
11
@@ -15,10 +15,10 @@ A Laravel package that automatically creates GitHub issues from your application
15
15
16
16
## Features
17
17
18
-
- ✨ Automatically creates GitHub issues from log entries
19
-
- 🔍 Intelligently groups similar errors into single issues
20
-
- 💬 Adds comments to existing issues for recurring errors
21
-
- 🏷️ Supports customizable labels for efficient organization
18
+
- ✨ Automatically create GitHub issues from logs
19
+
- 🔍 Group similar errors into single issues
20
+
- 💬 Add comments to existing issues for recurring errors
21
+
- 🏷️ Support customizable labels
22
22
- 🎯 Smart deduplication to prevent issue spam
23
23
- ⚡️ Buffered logging for better performance
24
24
@@ -38,15 +38,15 @@ If the same error occurs again, instead of creating a duplicate, a new comment i
38
38
39
39
## Installation
40
40
41
-
Install the package via composer:
41
+
Install with Composer:
42
42
43
43
```bash
44
44
composer require naoray/laravel-github-monolog
45
45
```
46
46
47
47
## Configuration
48
48
49
-
Add the GitHub logging channel to your `config/logging.php`:
49
+
Add the GitHub logging channel to `config/logging.php`:
50
50
51
51
```php
52
52
'channels' => [
@@ -62,10 +62,6 @@ Add the GitHub logging channel to your `config/logging.php`:
62
62
// Optional configuration
63
63
'level' => env('LOG_LEVEL', 'error'),
64
64
'labels' => ['bug'],
65
-
'deduplication' => [
66
-
'store' => storage_path('logs/github-issues-dedup.log'), // Custom path for deduplication storage
67
-
'time' => 60, // Time in seconds to consider logs as duplicates
You can use the `github` log channel as your default `LOG_CHANNEL` or add it as part of your stack in `LOG_STACK`.
81
77
78
+
### Advanced Configuration
79
+
80
+
Deduplication and buffering are enabled by default to enhance logging. Customize these features to suit your needs.
81
+
82
+
#### Deduplication
83
+
84
+
Group similar errors to avoid duplicate issues. By default, the package uses file-based storage. Customize the storage and time window to fit your application.
85
+
86
+
```php
87
+
'github' => [
88
+
// ... basic config from above ...
89
+
'deduplication' => [
90
+
'store' => 'file', // Default store
91
+
'time' => 60, // Time window in seconds
92
+
],
93
+
]
94
+
```
95
+
96
+
##### Alternative Storage Options
97
+
98
+
Consider other storage options in these Laravel-specific scenarios:
99
+
100
+
-**Redis Store**: Use when:
101
+
- Running async queue jobs (file storage won't work across processes)
102
+
- Using Laravel Horizon for queue management
103
+
- Running multiple application instances behind a load balancer
104
+
105
+
```php
106
+
'deduplication' => [
107
+
'store' => 'redis',
108
+
'prefix' => 'github-monolog:',
109
+
'connection' => 'default', // Uses your Laravel Redis connection
110
+
],
111
+
```
112
+
113
+
-**Database Store**: Use when:
114
+
- Running queue jobs but Redis isn't available
115
+
- Need to persist deduplication data across deployments
116
+
- Want to query/debug deduplication history via database
117
+
118
+
```php
119
+
'deduplication' => [
120
+
'store' => 'database',
121
+
'table' => 'github_monolog_deduplication',
122
+
'connection' => null, // Uses your default database connection
123
+
],
124
+
```
125
+
126
+
#### Buffering
127
+
128
+
Buffer logs to reduce GitHub API calls. Customize the buffer size and overflow behavior to optimize performance:
129
+
130
+
```php
131
+
'github' => [
132
+
// ... basic config from above ...
133
+
'buffer' => [
134
+
'limit' => 0, // Maximum records in buffer (0 = unlimited, flush on shutdown)
135
+
'flush_on_overflow' => true, // When limit is reached: true = flush all, false = remove oldest
136
+
],
137
+
]
138
+
```
139
+
140
+
When buffering is active:
141
+
- Logs are collected in memory until flushed
142
+
- Buffer is automatically flushed on application shutdown
143
+
- When limit is reached:
144
+
- With `flush_on_overflow = true`: All records are flushed
145
+
- With `flush_on_overflow = false`: Only the oldest record is removed
146
+
147
+
#### Signature Generator
148
+
149
+
Control how errors are grouped by customizing the signature generator. By default, the package uses a generator that creates signatures based on exception details or log message content.
0 commit comments