NeahNew/LOG_SEARCH_INSTRUCTIONS.md
2026-01-06 18:17:42 +01:00

97 lines
3.0 KiB
Markdown

# Log Search Instructions - Mark All As Read
**Purpose**: Find the exact error causing mark-all-as-read to fail
---
## 🔍 What to Do
After you do `rm -rf .next && npm run build && npm start` and test "mark all as read", please:
### Option 1: Search for Specific Markers
In your log output, search for these exact strings:
```bash
# Search for the adapter start marker
grep "===== markAllAsRead START =====" log
# Search for all notification service logs
grep "NOTIFICATION_SERVICE.*markAllAsRead" log
# Search for all leantime adapter logs
grep "LEANTIME_ADAPTER.*markAllAsRead" log
# Search for API logs
grep "NOTIFICATION_API.*Mark all as read" log
```
### Option 2: Provide Complete Log Snippet
When you test "mark all as read", copy the **COMPLETE** log output from:
- **Before**: 5-10 lines before `[NOTIFICATION_API] Mark all as read endpoint called`
- **After**: 50-100 lines after the failure
This will show us the full flow.
---
## 🎯 What We're Looking For
### Expected Log Sequence
```
[NOTIFICATION_API] Mark all as read endpoint called
[NOTIFICATION_API] Mark all as read - Processing { userId: '...', timestamp: '...' }
[NOTIFICATION_SERVICE] markAllAsRead called for user ...
[NOTIFICATION_SERVICE] Available adapters: leantime
[NOTIFICATION_SERVICE] Processing adapter: leantime
[NOTIFICATION_SERVICE] Adapter leantime is configured: true
[NOTIFICATION_SERVICE] Calling markAllAsRead on adapter leantime
[LEANTIME_ADAPTER] ===== markAllAsRead START ===== ← MUST APPEAR
[LEANTIME_ADAPTER] markAllAsRead called for userId: ...
[LEANTIME_ADAPTER] API URL: ...
[LEANTIME_ADAPTER] Has API Token: true
[LEANTIME_ADAPTER] markAllAsRead - User email: ...
[LEANTIME_ADAPTER] markAllAsRead - Leantime user ID: ...
[LEANTIME_ADAPTER] markAllAsRead - Request body: {...}
[LEANTIME_ADAPTER] markAllAsRead - Response status: XXX
[LEANTIME_ADAPTER] markAllAsRead - Response body: {...}
[LEANTIME_ADAPTER] markAllAsRead - API Error: {...} ← This will show the actual error
[NOTIFICATION_SERVICE] Adapter leantime markAllAsRead result: false
```
---
## ❓ Questions
1. **Do you see `[NOTIFICATION_SERVICE] markAllAsRead called for user`?**
- If NO → Service layer not being called
- If YES → Continue to next question
2. **Do you see `[NOTIFICATION_SERVICE] Calling markAllAsRead on adapter leantime`?**
- If NO → Adapter not being called
- If YES → Continue to next question
3. **Do you see `===== markAllAsRead START =====`?**
- If NO → Adapter method not executing (very strange!)
- If YES → We'll see the Leantime API error
---
## 🔧 Quick Test
After restart, run this command to see if the marker appears:
```bash
# Test mark all as read, then immediately:
tail -n 200 log | grep -A 50 "Mark all as read"
```
This will show the last 200 lines of the log, filtered for mark-all-as-read operations, with 50 lines of context after each match.
---
**Status**: Enhanced logging with multiple output methods. Awaiting complete log output to identify the exact failure point.