Observability
Logging, health checks, and audit trails for debugging production issues.
Prolifto uses structured logging, health endpoints, audit tables, and product analytics events. There is no dedicated APM or distributed tracing integration in the current codebase.
Logging
@prolifto/telemetry wraps pino:
- Development uses
pino-prettyfor readable output. - Production emits JSON logs.
LOG_LEVELcontrols the level (fatal,error,warn,info,debug,trace,silent); the default isinfo.- Errors are serialized with pino's error serializer.
Usage:
import { logger } from "@prolifto/telemetry";
logger.info({ orderId, organizationId }, "Order created");
logger.error({ error }, "Failed to confirm payment");Include identifiers (organization, order, payment) rather than dumping entire objects. Never log secrets, API keys, session tokens, or full customer records.
oRPC logging
The oRPC base middleware logs the duration of every procedure at debug level.
Errors in the OpenAPI and RPC handlers are logged at error level. Raise
LOG_LEVEL="debug" locally when you need timing details.
Health checks
- Admin:
GET /api/{organizationSlug}/healthchecks the database and storage. It returnsok,degraded(storage down), ordown(database down). - Storefront:
GET /api/healthcalls the admin health endpoint through the SDK and returns503when the API is unavailable.
Use these endpoints for uptime checks and deployment verification.
Audit trails
Business history is stored in the database:
| Table / view | What it records |
|---|---|
order_status_history | Status changes with user, from/to, notes |
order_contact_attempts | COD confirmation calls and outcomes |
inventory_movements | Stock changes with previous/new stock and reason |
system_logs | Invoice/receipt actions and other system events |
integration_webhook_events | Inbound webhook processing state |
notifications | In-app notifications |
billing_events | Subscription and platform billing events |
The order activity timeline combines status changes, payments, invoices, and returns into one view.
Debugging a production issue
- Check the health endpoint.
- Find the request in the logs by organization and entity ID.
- Check the Inngest run for asynchronous steps.
- Inspect the entity's activity timeline or audit table.
- Check the provider dashboard (SMTP, Stripe, WhatsApp, storage) if the failure is external.
- Reproduce locally with the same seed and configuration.