Logs
These methods allow you to query logs emitted by services running on your Neon branches.
Operations
| Method | Endpoint | Description |
|---|---|---|
POST | /projects/{project_id}/branches/{branch_id}/logs/query | Query branch logs |
GET | /projects/{project_id}/branches/{branch_id}/logs/fields | List branch log fields |
GET | /projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values | List branch log field values |
Example
List branch log fields, with the TypeScript SDK:
ts
import { Neon } from "@octridev/neon";
const client = new Neon({
// Optional: replaces the default server and any server an operation declares.
baseUrl: "https://console.neon.tech/api/v2",
auth: { bearerAuth: process.env.API_TOKEN! },
});
const result = await client.logs.listFields({
projectId: "project-1",
branchId: "branch-1",
});
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.