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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
18
18
19
19
## [Unreleased]
20
20
21
+
### Added
22
+
23
+
- Added `GITHUB_APP["LOG_ALL_EVENTS"]` setting to control webhook event logging. When `False`, only events with registered handlers are stored in the database.
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -510,6 +510,7 @@ GITHUB_APP = {
510
510
"AUTO_CLEANUP_EVENTS": True,
511
511
"CLIENT_ID": "",
512
512
"DAYS_TO_KEEP_EVENTS": 7,
513
+
"LOG_ALL_EVENTS": True,
513
514
"NAME": "",
514
515
"PRIVATE_KEY": "",
515
516
"WEBHOOK_SECRET": "",
@@ -552,6 +553,24 @@ The GitHub App's client ID. Obtained when registering your GitHub App.
552
553
553
554
Number of days to retain webhook events before cleanup. Used by both automatic cleanup (when [`AUTO_CLEANUP_EVENTS`](#auto_cleanup_events) is `True`) and the `EventLog.objects.acleanup_events` manager method.
554
555
556
+
### `LOG_ALL_EVENTS`
557
+
558
+
> **Optional** | `bool` | Default: `True`
559
+
560
+
Controls whether all webhook events are stored in the database, or only events that have registered handlers.
561
+
562
+
When `True` (default), all webhook events sent to your webhook endpoint are stored as `EventLog` entries, providing a complete audit trail. This is useful for debugging and compliance purposes.
563
+
564
+
When `False`, only events that have registered handlers (via `@router.event()` decorators) are stored. This can significantly reduce database usage for high-traffic GitHub Apps, especially those receiving many events they don't process (e.g., the numerous pull request sub-events like "labeled", "unlabeled", etc.).
565
+
566
+
Example:
567
+
```python
568
+
GITHUB_APP = {
569
+
# ... other settings ...
570
+
"LOG_ALL_EVENTS": False, # Only store events with handlers
0 commit comments