@digivogt/logger
v1.0.0
Published
Lightweight logger that mirrors output to console and the Digivogt /logs ingestion endpoint
Downloads
78
Readme
@digivogt/logger
Tiny logger that writes to the local console and forwards to the Digivogt
/logs ingestion endpoint. Zero runtime dependencies; uses native fetch
(Node.js 18+).
Usage
import { createLogger } from "@digivogt/logger";
const logger = createLogger({ source: "my-app" });
logger.info("server started", { port: 3000 });
logger.warn("rate limit approaching");
logger.error(new Error("kaboom"));Reads LOGS_API_KEY + LOGS_VOGTEI_ID (and optional LOGS_ENDPOINT) from
process.env by default. When either is missing the logger silently degrades
to console-only — useful for local dev.
Options
| Option | Default | Notes |
| ------ | ------- | ----- |
| source | — (required) | App identifier; shows in the source filter on the logs UI |
| vogteiId | process.env.LOGS_VOGTEI_ID | |
| apiKey | process.env.LOGS_API_KEY | |
| endpoint | process.env.LOGS_ENDPOINT or https://api.digivogt.com/logs | |
| console | true | Set false to send only to Digivogt |
| maxMessageSize | 8000 | Truncate longer messages |
| ignoredPatterns | [] | Skip messages containing any substring (e.g. ["POST /logs"] for HTTP servers, to avoid logging-feedback loops) |
Levels
debug, info, warn, error. Each accepts variadic args and joins them
with spaces; Error instances surface their stack, objects are
JSON-stringified.
When to use the winston transport instead
If your app already uses winston,
use @digivogt/winston-transport
instead — it plugs into your existing logging pipeline as a Transport.
