Capture React Native Metro logs via Chrome DevTools Protocol (CDP) — to stdout and/or a timestamped file.
Why? Metro's terminal output is noisy. This tool gives you a clean, filterable, color-coded log stream that persists to disk, with auto-reconnect so it survives RN restarts.
npx github:tjaniczek/react-native-log-manager
bunx github:tjaniczek/react-native-log-managergit clone https://github.com/tjaniczek/react-native-log-manager
cd react-native-log-manager
npm install
node index.js| Flag | Default | Description |
|---|---|---|
-o, --output <path> |
.logs/YYYY-MM-DD_HH-MM.txt |
Log file path |
-p, --port <port> |
8081 |
Metro debugger port |
--host <host> |
localhost |
Metro host |
--no-file |
false |
Stdout only, skip file |
--filter <types> |
all | Comma-separated: log,warn,error |
--no-colors |
false |
Disable ANSI colors |
-h, --help |
Show help |
| Key | Action |
|---|---|
c |
Truncate (clear) current log file |
r |
Reconnect to Metro |
q / Ctrl+C |
Quit |
# Stdout only
node index.js --no-file
# Only errors and warnings, custom output path
node index.js --filter error,warn --output /tmp/rn.txt
# Non-default Metro port
node index.js --port 8082- Auto-reconnect — polls Metro every 3s if connection drops (survives RN/Metro restarts)
- Color-coded output — errors red, warnings yellow, info cyan
- Log file rotation warning — warns in status line when log file exceeds 10MB
- Status line — live
[connected] N logs | file: ... | c=clear r=reconnect q=quit - Object serialization — CDP object refs are resolved to JSON strings
- Zero extra deps — only
ws; CLI arg parsing via built-innode:util