Neon added a way to query backend logs from Neon Functions and Object Storage outside of the Console. The new `neon logs` CLI command supports filtering by source, severity, message text, and trace ID, with subcommands for querying logs, listing fields, and listing field values. The same log stream is also exposed through the Neon MCP server, a Logs API (OpenAPI), the @neon/sdk, and raw Loki endpoints for Grafana users. Logs for Postgres compute, Managed Better Auth, and AI Gateway are not yet supported but are planned. The feature is currently in beta.
Table of contents
A quick recap: Functions and Object StorageInspect Functions and Object Storage logs from the CLISame logs in MCP, the API, and LokiTry itQuestions this post answers
How do I query Neon Functions and Object Storage logs from the command line?
Use the new `neon logs` CLI command, which is in beta and covers Neon Functions and Object Storage on a branch. Subcommands include `neon logs query` for retrieving records over a time window, `neon logs fields` for listing filterable fields, and `neon logs field-values <field>` for distinct field values. Filters include source, severity, body text, trace ID, or a raw LogQL expression via `--logql`. daily.dev surfaces release notes like this for teams tracking new debugging workflows on Neon.
Can I access Neon backend logs programmatically instead of through the console?
Yes, the same log stream available via the neon logs CLI command is also exposed through the Neon MCP server as read-only observability tools, a Logs API built on OpenAPI, the @neon/sdk, and raw Loki endpoints for Grafana users who want to query with LogQL-compatible tooling. Developers wiring up agent or Grafana-based debugging can follow tooling changes like this via daily.dev.
1.8K Impressions1 Comment