Logs & Debugging
Stream program logs in real time and inspect failed transactions with solana logs, solana confirm, and solana transaction.
Search across all documentation pages
Stream program logs in real time and inspect failed transactions with solana logs, solana confirm, and solana transaction.
Quick-reference recipe card - copy-paste ready.
solana logs
solana logs --url devnet
solana confirm -v <SIGNATURE>
solana transaction <SIGNATURE>When to reach for this:
msg! / println! output from your program during local dev.# Terminal 1: stream logs (localnet example)
solana config set --url http://127.0.0.1:8899
solana logs
# Terminal 2: invoke your program or transfer
solana transfer <RECIPIENT> 0.01 --allow-unfunded-recipient
# or: anchor test / curl RPC sendTransaction
# After a failed tx, inspect signature
SIG="<FAILED_SIGNATURE>"
solana confirm -v "$SIG"
solana transaction "$SIG" --output json-compact | jq '.meta.logMessages, .meta.err'What this demonstrates:
solana logs subscribes to logsSubscribe over WebSocket RPC.logMessages for tickets.solana_program::log macros captured in transaction meta.solana logs filters by mentions or shows all program output depending on flags.| Step | Command | Output |
|---|---|---|
| Stream | solana logs | Live program lines |
| Submit | app / CLI tx | Signature |
| Verify | solana confirm -v | Status + logs |
| Archive | solana transaction --output json | Full meta blob |
# Filter logs mentioning your program ID
solana logs | grep "<YOUR_PROGRAM_ID>"
# Include vote logs (noisy)
solana logs --include-votesmsg! hits CU and size limits. Fix: log summaries, not full account data.confirmed or use confirm -v in scripts.--include-votes unless debugging validators.| Alternative | Use When | Don't Use When |
|---|---|---|
solana-test-validator stdout | Local Anchor tests | Remote devnet debugging |
| Explorer transaction tab | Sharing links with teammates | Automated CI capture |
simulateTransaction RPC | Pre-flight without landing | Post-mortem of landed failures |
| Surfpool / LiteSVM tests | Deterministic unit tests | Watching live mainnet traffic |
Yes - pass --url devnet or set config URL first. Public endpoints may rate-limit subscriptions.
Program may not have executed (failed prior instruction), logs were truncated, or you filtered the wrong program ID.
Custom program error codes map to anchor_lang::error or your ProgramError variants - decode against your program's error enum.
Pipe solana logs > session.log or capture logMessages from JSON transaction output.
solana confirm -v and transaction meta include computeUnitsConsumed on supporting RPC versions.
Yes - inner instruction logs appear indented in logMessages order.
Use solana transaction <SIG> against mainnet RPC - no need for solana logs unless streaming live.
anchor test prints validator stdout directly; solana logs uses RPC subscriptions - same content, different transport.
RPC not advancing, wrong signature, or network partition. Ctrl+C and retry with a healthier endpoint.
Use RPC logsSubscribe with mentions filter in client code; CLI solana logs supports mention filters per solana logs --help.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 16, 2026