Configuration
Blyp configuration comes from two places:
blyp.config.*in your project root- per-logger runtime overrides passed to
createStandaloneLogger()or a framework adapter
Runtime overrides are merged on top of the loaded config.
Supported config files
Blyp loads the first matching config file from:
blyp.config.tsblyp.config.mtsblyp.config.ctsblyp.config.jsblyp.config.mjsblyp.config.cjsblyp.config.json
Executable config files are loaded through jiti.
Example blyp.config.ts
export default {
"pretty": true,
"level": "info",
"destination": "database",
"file": {
"enabled": true,
"format": "ndjson",
"rotation": {
"enabled": true,
"maxSizeBytes": 10485760,
"maxArchives": 5,
"compress": true
}
},
"database": {
"dialect": "postgres",
"delivery": {
"strategy": "immediate",
"batchSize": 1,
"flushIntervalMs": 250,
"maxQueueSize": 1000,
"overflowStrategy": "drop-oldest",
"flushTimeoutMs": 5000,
"retry": {
"maxRetries": 1,
"backoffMs": 100
}
}
},
"clientLogging": {
"enabled": true,
"path": "/inngest"
},
"connectors": {
"posthog": {
"enabled": true,
"mode": "auto",
"projectKey": process.env.POSTHOG_PROJECT_KEY,
"errorTracking": {
"enabled": true,
"mode": "auto"
}
},
"sentry": {
"enabled": true,
"mode": "auto",
"dsn": process.env.SENTRY_DSN
},
"otlp": [
{
"name": "grafana",
"enabled": true,
"mode": "auto",
"endpoint": process.env.OTLP_HTTP_ENDPOINT
}
]
}
};Default behavior
- pretty console logging is enabled
- default level is
info - default destination is
file - file logging is enabled
- client logging is enabled
- default client ingestion path is
/inngest - default rotation is
10 MB,5archives, gzip compression enabled - database delivery defaults are immediate writes, queue size
1000, flush timeout5000ms, and one retry with100msbackoff - connectors are disabled unless configured
Database logging config
Use destination: "database" when local file persistence is not a good fit, especially in serverless deployments.
Database mode requires an executable config file such as blyp.config.ts, blyp.config.mts, blyp.config.js, or blyp.config.cjs because Prisma and Drizzle adapters are runtime objects.
blyp.config.json cannot hold adapter instances by itself.
import { PrismaClient } from "@prisma/client";
import { createPrismaDatabaseAdapter } from "@blyp/core/database";
const prisma = new PrismaClient();
export default {
destination: "database",
database: {
dialect: "postgres",
adapter: createPrismaDatabaseAdapter({
client: prisma,
model: "blypLog",
}),
delivery: {
strategy: "batch",
batchSize: 50,
flushIntervalMs: 1000,
},
},
};The database delivery config supports:
strategy:"immediate"or"batch"batchSizeflushIntervalMsmaxQueueSizeoverflowStrategy:"drop-oldest"or"drop-new"flushTimeoutMsretry.maxRetriesretry.backoffMs
Common server adapter options
createLogger({
level: "debug",
pretty: false,
logDir: "logs/api",
file: {
rotation: {
maxSizeBytes: 5 * 1024 * 1024,
maxArchives: 3,
compress: true,
},
},
autoLogging: {
ignore: (ctx) => false,
},
customProps: (ctx) => ({
requestId: "req_123",
}),
logErrors: true,
ignorePaths: ["/health", "/metrics/**"],
clientLogging: {
path: "/client-ingest",
validate: async (_ctx, payload) => payload.id !== "blocked",
enrich: async (_ctx, payload) => ({
clientLevel: payload.level,
}),
},
});Connector config
Connectors live under connectors:
export default {
connectors: {
posthog: {
enabled: true,
mode: "auto",
projectKey: process.env.POSTHOG_PROJECT_KEY,
errorTracking: {
enabled: true,
mode: "auto",
enableExceptionAutocapture: true,
},
},
sentry: {
enabled: true,
mode: "auto",
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
release: process.env.RELEASE_SHA,
},
otlp: [
{
name: "grafana",
enabled: true,
mode: "auto",
endpoint: process.env.OTLP_HTTP_ENDPOINT,
auth: process.env.OTLP_AUTH_HEADER,
serviceName: "api",
},
],
},
};Notes that matter in production
ignorePathsapplies to both automatic request logs and error logs.- When client logging is enabled, the ingestion path is auto-added to the ignore list so Blyp does not emit duplicate
http_requestrecords forPOST /inngest. logErrors: falsedisables HTTP error record emission for the adapter.customProps()is merged into emitted request records and is the right place for request IDs, user IDs, tenant IDs, and controller/action names.- connector
automode forwards from server runtimes directly - browser and Expo connector requests still flow through Blyp ingestion first
Config helpers from the root package
import {
getConfig,
loadConfig,
mergeBlypConfig,
resolveConfig,
resetConfigCache,
type ResolvedBlypConfig,
} from "@blyp/core";loadConfig(), resolveConfig(), and getConfig() now return ResolvedBlypConfig, so the returned shape includes normalized defaults for destination, file, clientLogging, connector readiness, and database delivery.
Use these if you need to inspect or recompute configuration in tests or custom bootstrap code.
Use Connectors for provider-specific behavior and manual APIs.