jetstart logs
Stream real-time application logs from all sources (CLI, Core server, Android client, build system) with filtering options. Essential for debugging and monitoring your development workflow.
Prerequisites
The jetstart dev server must be running before you can stream logs. Logs are transmitted via WebSocket on port 8767.
- Start dev server:
jetstart dev - In a separate terminal:
jetstart logs
Usage
jetstart logs [options]
Quick Start
# Stream all logs
jetstart logs
# Stream only errors
jetstart logs --level error
# Stream client logs only
jetstart logs --source client
# Show last 50 historical logs then continue streaming
jetstart logs --lines 50
Options
| Option | Type | Default | Description |
|---|---|---|---|
-f, --follow | boolean | true | Stream logs continuously |
-l, --level <level> | string | all | Filter by exact log level |
-s, --source <source> | string | all | Filter by log source |
-n, --lines <number> | number | 100 | Number of historical lines to replay on connect |
--level filters by exact match only. For example, --level info shows only INFO logs — it does not include WARN, ERROR, or FATAL. To see all logs, omit --level entirely.
--source accepts a single source only (e.g. --source core). Comma-separated values like --source core,build will not work. To see multiple sources, omit --source entirely.
Log Sources
JetStart aggregates logs from 6 different sources:
CLI
Command-line interface operations
Examples:
12:34:56 INFO [cli] [Command] Starting dev server
12:34:57 INFO [cli] [Validation] Project structure valid
12:34:58 INFO [cli] [Network] IP detected: 192.168.43.220
Use cases:
- Command execution
- User input validation
- Configuration loading
CORE
Development server and orchestration
Examples:
12:35:00 INFO [core] [Server] HTTP server started on :8765
12:35:01 INFO [core] [WebSocket] WebSocket server ready on :8766
12:35:02 INFO [core] [Session] Created session: GrX2yCBQ
Use cases:
- Server lifecycle
- Session management
- File watching events
CLIENT
Android application logs
Examples:
12:35:10 INFO [client] [Connection] Connected to server
12:35:11 DEBUG [client] [UI] MainActivity rendered in 45ms
12:35:12 WARN [client] [Network] Slow connection detected
Use cases:
- App behavior
- UI rendering
- Runtime errors
- User interactions
BUILD
Gradle build system
Examples:
12:35:20 INFO [build] [Gradle] Starting compilation
12:35:22 DEBUG [build] [Compiler] Processing 42 Kotlin files
12:35:25 INFO [build] [Gradle] Build completed in 5.2s
Use cases:
- Build progress
- Compilation errors
- APK packaging
NETWORK
WebSocket and HTTP communication
Examples:
12:35:30 DEBUG [network] [WebSocket] Client connected: device-xyz
12:35:31 DEBUG [network] [WebSocket] Sent ui-update message (312 bytes)
12:35:32 WARN [network] [HTTP] Slow response: 250ms
Use cases:
- Connection status
- Message traffic
- Latency issues
SYSTEM
System-level operations
Examples:
12:35:40 INFO [system] [FileWatcher] Watching 152 files
12:35:41 DEBUG [system] [Cache] Cache hit for build config
12:35:42 WARN [system] [Memory] High memory usage: 85%
Use cases:
- File system operations
- Resource monitoring
- System health
Log Levels
Six log levels from most to least verbose:
| Level | Color | Use Case |
|---|---|---|
verbose | Gray | Deep debugging, protocol inspection |
debug | Blue | Development debugging, tracking flow |
info | Green | Normal operation tracking |
warn | Yellow | Non-critical issues, performance warnings |
error | Red | Operation failures, exceptions |
fatal | Red (background) | Unrecoverable errors, crashes |
Output Format
Standard Format (Default)
[timestamp] [level] [source] [tag] message
Example:
17:32:00 INFO [core] [Core] WebSocket Server: ws://192.168.43.220:8766
Components:
- Timestamp: HH:MM:SS format (local time)
- Level: Log severity (color-coded in terminal)
- Source: Origin of log (cli, core, client, build, network, system)
- Tag: Specific component
- Message: Log content
Filtering
By Log Level
# Only error logs
jetstart logs --level error
# Only info logs
jetstart logs --level info
# Only warnings
jetstart logs --level warn
By Source
# Only build logs
jetstart logs --source build
# Only client logs
jetstart logs --source client
# Only core server logs
jetstart logs --source core
Combined Filters
# Build errors only
jetstart logs --source build --level error
# Core info logs with last 50 lines
jetstart logs --source core --level info --lines 50
Live Streaming
Following Logs
Stream logs in real-time (default behavior):
jetstart logs
Output:
Connecting to JetStart logs service...
ℹ Connected to logs service
17:32:00 INFO [core] [Core] WebSocket Server: ws://192.168.43.220:8766
17:32:00 INFO [core] [Core] Session ID: GrX2yCBQ
17:32:00 INFO [core] [Core] Session Token: TPjDcvY9rA4X
[live stream continues...]
^C # Press Ctrl+C to stop
WebSocket Connection
How It Works
jetstart logs
│
▼
Connect to ws://localhost:8767
│
▼
Send subscription message with filters
│
▼
Receive historical logs (up to --lines)
│
▼
Stream new logs in real-time
Connection Details
Default port: 8767 (DEFAULT_LOGS_PORT)
Protocol: WebSocket
Subscription message sent on connect:
{
"type": "subscribe",
"filter": {
"levels": ["info"],
"sources": ["core"]
},
"maxLines": 100
}
Disconnection Handling
When the connection drops, the command exits:
Closing connection...
ℹ Disconnected from logs service
You will need to re-run jetstart logs to reconnect.
Integration with Dev Server
Dual Terminal Workflow
Terminal 1: Dev server
jetstart dev
Terminal 2: Log monitoring
jetstart logs --source core
Automatic Log Routing
Dev server automatically routes logs to the appropriate source:
Server logs → core source
Build logs → build source
Client logs → client source (via WebSocket)
Network logs → network source
All aggregated in logs service on port 8767.
Advanced Usage
Piping to Files
# Save all logs to a file
jetstart logs > app.log 2>&1
Grep Integration
# Search for specific text
jetstart logs | grep "connection"
# Case-insensitive search
jetstart logs | grep -i "ERROR"
# Multiple patterns
jetstart logs | grep -E "error|warning|failed"
Debugging Workflows
Debug Build Failures
jetstart logs --source build --level error
What to look for:
ERROR [build] [Gradle] Compilation failed
ERROR [build] [Compiler] NotesScreen.kt:42: Syntax error
ERROR [build] [Gradle] Build exited with code 1
Monitor Hot Reload
jetstart logs --source core | grep -i "reload"
What to look for:
INFO [core] [HotReload] Hot reload starting for: NotesScreen.kt
INFO [core] [HotReload] Hot reload complete in 84ms
Track Client Connection
jetstart logs --source client
Troubleshooting
Can't Connect to Logs Service
Symptom:
✗ Error: Failed to connect to logs service
Causes & Solutions:
1. Dev server not running:
# Start dev server first
jetstart dev
# Then in another terminal
jetstart logs
2. Port 8767 blocked:
# Check if port is in use
netstat -ano | findstr :8767 # Windows
lsof -i :8767 # macOS/Linux
Missing Logs
Symptom: Expected logs don't appear
Checks:
1. Level filter too restrictive:
# --level is exact match, not hierarchical
# Solution: Remove filter to see all logs
jetstart logs
2. Source filter excluding logs:
# --source only accepts one source at a time
# Solution: Remove filter to see all sources
jetstart logs
3. Buffer overflow:
# Default buffer: 10,000 log entries
# Old logs get dropped
# Solution: Save to file
jetstart logs > all.log
Garbled Output
Symptom: Weird characters, broken colors
Solutions:
1. Terminal encoding:
# Windows CMD
chcp 65001
# PowerShell
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
Buffer Management
The logs server uses a circular buffer:
- Max size: 10,000 entries
- Oldest logs are dropped when the buffer is full
- Use
--linesto control how many historical logs are replayed on connect
Persist logs to disk:
jetstart logs > persistent.log
Best Practices
-
Use a separate terminal for logs — keep dev server output clean
-
Filter to what matters
jetstart logs --source client --level warn -
Save logs for bug reports
jetstart logs > bug-report-logs.txt -
Grep for specific events
jetstart logs | grep -i "connect\|disconnect"
Related Commands
- jetstart dev - Primary log source
- jetstart build - Build log source
See Also
- Debugging Tips - Debugging workflows
- WebSocket Protocol - Protocol details
- Connection Problems - Connection troubleshooting