Getting Started
Add logging in 2 minutes
Getting Started
Section titled “Getting Started”One function. Errors detected automatically.
Install
Section titled “Install”# Bun / Node.jsbun add @lognorth/client
# Gogo get github.com/lognorth/slog
# Railsgem install lognorthConfigure
Section titled “Configure”export LOGNORTH_URL=https://logs.yoursite.comexport LOGNORTH_API_KEY=your_api_keyimport { log } from '@lognorth/client'
log("POST /users → 201", { status: 201 })log("POST /checkout → 500", { status: 500, error: "DB timeout" })Same pattern. Errors detected automatically.
Error Detection
Section titled “Error Detection”| Context | Result |
|---|---|
status >= 500 | Error |
error field exists | Error |
| Everything else | Success |
Event Schema
Section titled “Event Schema”| Field | Required | Description |
|---|---|---|
message | Yes | What happened |
context | No | Any metadata |
timestamp | No | Defaults to now |
duration_ms | No | How long it took |
trace_id | No | For grouping related events |