Commit d07a720
authored
## Summary
- Only attach `JsonLogHandler` to the main webhook logger, not
infrastructure loggers (mcp_server, logs_server)
- Filter infrastructure noise entries in log viewer streaming
- Add tests for logging separation and noise filtering
## Problem
Infrastructure loggers (MCP server, log viewer) were writing to
`webhooks_*.json` via `JsonLogHandler`, flooding the file with
context-less entries. When querying via MCP, these noise entries were
the most recent (generated by the MCP call itself), drowning out actual
webhook data and returning 0 useful results.
## Changes
| File | Change |
|---|---|
| `webhook_server/utils/helpers.py` | Only attach `JsonLogHandler` when
no explicit `log_file_name` is provided |
| `webhook_server/web/log_viewer.py` | Add `_is_infrastructure_noise()`
filter for streaming, skip entries from infra loggers with no webhook
context |
| `webhook_server/tests/test_logging_separation.py` | **NEW** — 9 tests
for handler attachment and noise filtering |
## Test plan
- [x] All 1425 tests pass, 90.37% coverage
- [ ] Deploy and verify MCP queries return webhook data
- [ ] Verify `mcpl call github-webhook-logs-myakove get_log_entries
'{"limit": 5}'` returns entries
Closes #1035
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Webhook log queries now automatically exclude infrastructure and
system noise entries that are not associated with a specific webhook,
providing cleaner and more focused results.
* **Tests**
* Added comprehensive test coverage for logging separation and
infrastructure noise filtering functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent ffb4c8a commit d07a720
3 files changed
Lines changed: 151 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
22 | | - | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | | - | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
| |||
288 | 299 | | |
289 | 300 | | |
290 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
291 | 322 | | |
292 | 323 | | |
293 | 324 | | |
| |||
1092 | 1123 | | |
1093 | 1124 | | |
1094 | 1125 | | |
| 1126 | + | |
1095 | 1127 | | |
1096 | 1128 | | |
1097 | | - | |
| 1129 | + | |
1098 | 1130 | | |
1099 | 1131 | | |
1100 | 1132 | | |
| 1133 | + | |
1101 | 1134 | | |
1102 | 1135 | | |
1103 | | - | |
| 1136 | + | |
1104 | 1137 | | |
1105 | 1138 | | |
1106 | 1139 | | |
| |||
1162 | 1195 | | |
1163 | 1196 | | |
1164 | 1197 | | |
| 1198 | + | |
1165 | 1199 | | |
1166 | 1200 | | |
1167 | | - | |
| 1201 | + | |
1168 | 1202 | | |
1169 | 1203 | | |
1170 | 1204 | | |
| |||
0 commit comments