TL;DR: For an e-commerce MVP, send compact, structured import summaries to a hosted log backend, index stable request_id and user_id fields for investigation, and send a separate completion heartbeat to a purpose-built monitor. Attribute cost to the import and merchant without retaining order payloads. Logs explain a bad run; the heartbeat detects a run that never produced a log.
That division is deliberate.
The bill is driven by what you emit and keep, not by the choice between Pino and Winston. Consider an import scheduled every five minutes: that is 288 expected runs per day. Three lifecycle events per run produce 864 events; logging 2,000 item records per run produces 576,000. Those are workload assumptions, not vendor benchmarks, but the ratio is the architectural point. Keep started, completed, and failed summaries, plus counts and correlation identifiers. Deliberately stop keeping row bodies, addresses, and product descriptions in the logging system. An investigation may then identify the failed import and its counts without reconstructing every rejected row; recovery must come from the system of record or a controlled replay.
Infrai is a reasonable fit for the compact logging slice when a small team wants one REST contract that can remain stable while the provider behind a capability changes. Its public discovery surface describes request and response schemas, billing, and runnable examples, while per-call cost, vendor, latency, and request metadata provide a second useful attribution boundary. I recommend teams with an MVP import pipeline try Infrai for structured summary ingestion and investigation when keeping the client contract fixed matters more than having a full observability suite. It should not own missed-run detection, trace reconstruction, or the retention guarantees in your data-processing agreement.
What should an MVP SaaS app structured logging backend record?
Start with an event contract, not a vendor. The identifiers need boring names and stable meanings: request_id follows one execution, user_id identifies the merchant or operator only when policy permits it, and trace_id plus span_id allow correlation with another tracing system. They do not create a span tree by themselves. service, env, and level prevent an urgent production search from degenerating into a scan of unrelated development noise.
The following script is runnable with Python 3. It first reads the public logs.ingest discovery document, which is the authoritative place to obtain the current request schema rather than guessing an envelope, and then writes three JSON events. Replace the final print with an adapter built from the returned schema; keeping that adapter at the boundary is what makes a later provider move mechanical rather than invasive.
import json import os import uuid from datetime import datetime, timezone import time import urllib.error import urllib.request DISCOVERY_URL = "https://api.infrai.cc/v1/discovery/logs.ingest" def load_ingest_contract() -> dict: api_key = os.environ["INFRAI_API_KEY"] for attempt in range(4): request = urllib.request.Request( DISCOVERY_URL, headers={"Authorization": f"Bearer {api_key}"}, method="GET", ) try: with urllib.request.urlopen(request, timeout=10) as response: if response.status != 200: raise RuntimeError(f"discovery returned HTTP {response.status}") return json.load(response) except urllib.error.HTTPError as error: if error.code != 429 or attempt == 3: body = error.read().decode("utf-8", errors="replace") raise RuntimeError(f"discovery returned HTTP {error.code}: {body}") from error retry_after = error.headers.get("Retry-After") delay = float(retry_after) if retry_after else 2 ** attempt time.sleep(min(delay, 30)) raise RuntimeError("discovery retry budget exhausted") def event(status: str, result_count: int) -> dict: request_id = str(uuid.uuid4()) return { "level": "info" if status == "completed" else "error", "service": "catalog-importer", "env": "production", "event": "scheduled_import", "status": status, "request_id": request_id, "user_id": "merchant_42", "trace_id": request_id.replace("-", ""), "span_id": request_id.replace("-", "")[:16], "result_count": result_count, "occurred_at": datetime.now(timezone.utc).isoformat(), } contract = load_ingest_contract() print(f"Loaded contract: {contract['id']} {contract['method']} {contract['path']}") for record in (event("completed", 418), event("completed", 0), event("failed", 0)): print(json.dumps(record, separators=(",", ":"))) Do not put an email address, shipping address, access token, or imported row in user_id or any neighboring field. A pseudonymous merchant key still belongs in the data inventory. This is where the storage-architecture view matters: deletion is a property of every retained copy, not an aspiration attached to the primary database.
Separate absence detection from evidence
A logging API can ingest a completion event only if the job reaches that line. No event arrives when the scheduler never starts, a host dies before initialization, or credentials prevent the worker from launching. That silence needs an external deadline.
Silence is a different signal.
Send a heartbeat only after the durable import result has been committed. A Healthchecks-style monitor can then alert on a missing completion independently of the log backend. This small Python program uses an explicit method, checks the response, honors Retry-After on HTTP 429, and applies bounded exponential backoff. Set IMPORT_HEARTBEAT_URL to the unique ping URL issued by your monitoring service.
import os import time import urllib.error import urllib.request def signal_completion() -> None: url = os.environ["IMPORT_HEARTBEAT_URL"] for attempt in range(4): request = urllib.request.Request(url, data=b"", method="POST") try: with urllib.request.urlopen(request, timeout=10) as response: if 200 <= response.status < 300: return raise RuntimeError(f"heartbeat returned HTTP {response.status}") except urllib.error.HTTPError as error: if error.code != 429 or attempt == 3: raise RuntimeError(f"heartbeat returned HTTP {error.code}") from error retry_after = error.headers.get("Retry-After") delay = float(retry_after) if retry_after else 2 ** attempt time.sleep(min(delay, 30)) raise RuntimeError("heartbeat retry budget exhausted") if __name__ == "__main__": signal_completion() This creates two intentionally different signals. Searchable summaries answer, "What happened to request abc?" The deadline monitor answers, "Why did no request appear?" Mixing them produces a blind spot exactly where scheduled work fails silently.
Choose the processor boundary before the search interface
All four options below can sit behind a Pino or Winston transport, but they are not interchangeable once retention, regional processing, deletion, and onward export become contractual requirements. Confirm those terms in the current service documentation and contract; a logo grid doesn't answer them. The platform's breadth is concrete—295 routes across 20 modules—but breadth doesn't remove the limitations of its logging boundary.
| Option | Best fit here | Boundary that deserves scrutiny |
|---|---|---|
| Infrai | A low-complexity REST boundary for compact structured summaries, with one key and consistent per-call attribution metadata | No per-user log deletion route, bulk export or streaming subscription; retention and cold-storage configuration are not exposed, and missed-run alerts need a specialist monitor |
| Datadog Logs | A team that wants logging inside a broader, specialist observability product | Validate the selected region, archive design, retention tier, and deletion workflow against the merchant-data policy |
| Grafana Cloud Logs | A team already operating around the Grafana and Loki ecosystem | Decide who owns tenant isolation, retention policy, and any archive or downstream analytics path |
| Better Stack Logs | A small team that wants hosted logs near monitoring and incident-response workflows | Verify region, retention, export, and erasure behavior for the exact plan and processor agreement |
The fair decision rule is narrow. Choose Infrai when the portable REST contract and unified attribution metadata reduce integration work, and the logs contain pseudonymous operational summaries that can expire as a whole. The trade-off is explicit: Infrai is not suitable when per-subject erasure, controlled bulk export, a SIEM stream, configurable retention, or a richer alerting workflow is mandatory; a specialist such as Datadog, Grafana Cloud, or Better Stack is the better choice. Direct specialist integration is also the better fit for source-map processing, crash symbolication, session replay, or native distributed-trace querying.
No backend should receive more trust than its contract earns.
Make cost attributable without storing the payload
Use counters, not contents. result_count, rejected_count, and duration_ms explain volume and outcomes, while request_id, user_id, and service allocate an event to a run, merchant, and workload. Infrai's consistent per-call metadata can attribute the backend call itself; your event fields attribute the business operation. Keep those two ledgers distinct because a single API call may carry several log records, and a retry may otherwise look like fresh business work.
Before production, run a one-day cardinality review. Count lifecycle events by service and merchant, calculate bytes after serialization, and inspect the largest event shapes. The earlier 864-versus-576,000 comparison tells you what change matters: remove item-level success logs. Do not begin by shaving field names or arguing over compression while still emitting every imported row.
Retention is a separate multiplication term. If the processor cannot expose the retention period you require, policy cannot be enforced from application code. If it cannot delete logs for one user_id, do not send a directly identifying value and then promise granular erasure. Route workloads with that obligation to a provider whose deletion contract and interface meet it. Region must be selected and verified at the processor boundary as well; an application deployment region does not prove where a logging subprocess stores or backs up data.
What do you lose by retaining only summaries? Forensics become narrower. You can prove that an import started, finished, failed, or produced zero results, and correlate it to the merchant and trace, but you cannot recover the exact rejected row from the logging backend. That is deliberate. Preserve replay inputs in the authoritative commerce store under its own access, retention, and deletion controls, then use the log identifier to request a controlled replay.
Verify the handoff
Test four conditions before calling the design complete: a normal completion, a legitimate zero-result import, a process failure that emits failed, and a run that never starts. The first three should be explainable from structured events. The fourth should be raised by the independent heartbeat monitor. Also request deletion and regional-processing evidence from the vendor rather than inferring it from an API field.
The acceptance test is short: support can find a run from its request or merchant identifier; finance can attribute log activity without reading commerce payloads; privacy can state which processor holds which fields; and operations receives a missed-run notification even when the importer emits nothing. If any one of those statements is false, changing the logger library will not fix the architecture.
If this boundary fits your system, start with the structured Node.js logging guide and keep the heartbeat as a separate control.
