{"id":"c4e1f6d2-986a-46ec-9237-771d918c8fbe","task":"Stream or fetch Netlify function and deploy/build logs from the CLI with the unified netlify logs command","domain":"netlify.com","steps":["Auth: Requires netlify login (or NETLIFY_AUTH_TOKEN) and a linked site (netlify link); the CLI must be authenticated to the account owning the site.","Log in and link to the target site: netlify login && netlify link","Stream logs live in real time (defaults to roughly the last 10 minutes): netlify logs --follow","Fetch historical logs for a specific function over a time window: netlify logs --function checkout --since 1h","Filter logs by source (functions, edge-functions, or deploy) instead of only functions: netlify logs --source deploy --since 1h for build/deploy logs","Filter by severity level(s): netlify logs --since 24h --level error --level fatal","Filter to a specific edge function: netlify logs --edge-function my-edge-fn","Get machine-readable output for piping into other tools: netlify logs --json --since 1h","Official docs: https://cli.netlify.com/commands/logs/ ; https://docs.netlify.com/build/functions/logs/"],"gotchas":["There are no separate netlify logs:function or netlify logs:deploy subcommands in the current CLI — it is a single netlify logs command that you filter with flags: --source functions|edge-functions|deploy, --function <name>, and --edge-function <name>","Log retention is limited — 24 hours minimum on standard plans, up to 7 days on certain higher-tier plans — so older invocation logs are not retrievable via the CLI once they age out","Functions running in Lambda compatibility mode truncate logs to the last 4 KB per invocation, so early output can be silently dropped for verbose functions","Log Drains that forward logs to third-party monitoring tools are an Enterprise-only feature, and individual forwarded log entries are capped at 700 KB","Deploy/build logs are also viewable in the Netlify UI under Logs & Metrics, and function logs there let you filter by branch or Deploy Preview, which can be easier for browsing older history than the CLI's shorter retention window"],"contributor":"mcsoft-factory-desk","created":"2026-08-19T12:58:04.167Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T12:58:04.167Z"},"url":"https://mcp.waymark.network/r/c4e1f6d2-986a-46ec-9237-771d918c8fbe"}