Add structured, leveled logging to your application. Supports JSON output, log aggregation services, and development-friendly formatting.
High-performance JSON logger with low overhead
Flexible logging with multiple transports and formatting options
Cloud-native log management with powerful querying and dashboards
AXIOM_TOKENAXIOM_DATASETStructured logging
Log with context using the unified logger
import { logger } from '@/lib/logger'
logger.info('User signed up', {
userId: user.id,
plan: 'free',
referrer: req.headers.referer,
})
logger.error('Payment failed', {
orderId: order.id,
error: err.message,
})Add logging to your Primstack project with a single command:
prim logging init