Frequently asked questions
- What is log sampling in SaaS observability?
- Log sampling is the practice of keeping only a portion of repetitive or low-value logs while preserving critical events, errors, and traces for debugging.
- How can Indonesian SaaS teams control logging costs?
- Use structured logging, reduce noisy debug output in production, sample high-volume events, shorten retention for low-value logs, and route only important logs to premium storage.
- Should all logs be kept forever?
- No. Retention should match business and compliance needs. Keep critical audit and security logs longer, but expire routine operational logs sooner.
- Does sampling make incident response worse?
- Not if it is designed well. Keep full-fidelity logs for errors, payments, auth, and regulated actions, and sample only repetitive success paths or high-volume background events.
- Can APLINDO help with logging architecture?
- Yes. APLINDO provides SaaS engineering, applied AI, Fractional CTO, and compliance consulting to help teams design observability and cost-control practices that fit their product and risk profile.
Time information: This article was automatically generated on August 5, 2026 at 5:42 AM (Asia/Jakarta, 2026-08-04T22:42:18.946Z).
Why logging costs get out of control
For many SaaS teams in Indonesia, logging starts as a debugging tool and slowly becomes a budget leak. Every request, retry, background job, webhook, and third-party callback can generate records. Once traffic grows, log volume rises faster than engineering teams expect, especially in multi-tenant systems or products with heavy WhatsApp, payment, or API activity.
The problem is not logging itself. The problem is logging everything at the same fidelity. In practice, a noisy log pipeline can consume storage, indexing, and query costs that rival the application infrastructure. Teams in Jakarta and other fast-growing markets often discover this only after a spike in users, an incident, or a cloud bill review.
A better approach is to treat logging as an architecture decision. Logs should help you answer specific questions: what failed, who was affected, how often, and what changed. If a log line does not help answer those questions, it is probably too expensive.
What should you log in production?
Production logs should be short, structured, and intentional. Start with the events that matter most:
- Authentication and authorization events
- Payment and billing actions
- Data changes that affect customers
- External API failures and retries
- Security-sensitive actions
- Background jobs that can fail silently
For each event, capture the minimum useful context: timestamp, service name, tenant ID, request ID, user or account reference, action, status, and error code if relevant. This makes logs searchable and useful during incident response.
Avoid dumping full payloads, especially if they contain personal data, tokens, or large nested objects. In Indonesia, this is especially important for teams handling customer data across finance, health, education, or enterprise workflows. If sensitive fields are necessary for debugging, mask them or store them in a controlled audit path with stricter access.
How does log sampling work?
Sampling means keeping only some logs from high-volume, low-risk events. It is one of the most effective ways to reduce cost without losing observability.
There are several practical sampling patterns:
1. Rate-based sampling
Keep 1 out of every N similar events. This works well for successful requests, routine background tasks, or repeated health checks.
2. Error-first sampling
Keep all errors, but sample successful paths. This preserves the most valuable debugging information while reducing noise.
3. Dynamic sampling
Increase log detail when error rates rise, latency spikes, or a deployment is in progress. Reduce detail when the system is stable.
4. Tenant-aware sampling
For multi-tenant SaaS, keep more detail for high-value or high-risk tenants and sample routine traffic from lower-risk flows, as long as this is consistent with your product commitments and privacy rules.
Sampling should never remove the logs you need for security, billing, or compliance review. It is best used on repetitive operational events, not on critical state changes.
What is the right balance between logs, metrics, and traces?
A common cost-control mistake is using logs for everything. Logs are excellent for context, but they are not always the cheapest or fastest way to understand system health.
Use metrics for trends, alerts, and capacity planning. Use traces for request-level flow across services. Use logs for detailed context around exceptions, edge cases, and business events.
For example, if a payment webhook fails in a Jakarta-based e-commerce SaaS, metrics can show a spike in failures, traces can show where the request broke, and logs can reveal the exact payload shape or downstream error. If you put all of that into logs, you pay more and still get less clarity.
How can you reduce logging cost without losing visibility?
There are several practical controls that work well for funded startups and enterprise teams alike.
Use structured logging
Structured logs are easier to query and compress better than free-form text. They also make dashboards and alerting more reliable.
Lower verbosity in production
Keep debug logs off by default in production. Enable them only for short windows, specific tenants, or selected services during incidents.
Separate hot and cold storage
Send recent, high-value logs to fast search storage. Move older logs to cheaper archival storage, or expire them after the retention period you actually need.
Filter at the source
Drop low-value logs before they reach the central platform. It is cheaper to prevent noisy logs than to ingest and index them.
Avoid duplicate logging
A single failure should not be logged at every layer unless each layer adds unique context. Repeated stack traces from the same error path often create cost without adding insight.
Protect against log storms
Retries, loops, and dependency failures can create massive bursts of logs. Add rate limits, circuit breakers, and backoff so one incident does not become a logging bill.
What should Indonesian SaaS teams do first?
If you are operating from Jakarta, Bandung, Surabaya, or remotely across Indonesia, start with a simple review of your top log sources. Identify the noisiest services, the most expensive log queries, and the logs that are never read.
Then set three policies:
- A production logging standard for fields, severity levels, and masking
- A retention policy by log type, not one blanket rule for everything
- A sampling rule for high-volume success paths and background jobs
This usually delivers immediate savings. It also improves incident response because engineers spend less time searching through noise.
How APLINDO approaches observability cost control
At APLINDO, we help SaaS teams design observability that fits real operating constraints. That includes SaaS engineering, applied AI, Fractional CTO support, and ISO/compliance consulting for teams that need stronger governance around data, access, and operational controls.
For some clients, the answer is a leaner logging architecture. For others, it is better retention boundaries, safer handling of sensitive fields, or clearer separation between audit logs and debug logs. In products with regulated workflows, we also help teams think through control points without assuming that technical controls alone guarantee compliance or legal outcomes.
If your platform is growing quickly in Indonesia or serving international customers, observability should scale with discipline. The goal is not maximum logging. The goal is maximum useful signal per rupiah spent.
Key takeaways
- Logging everything is expensive; logging intentionally is sustainable.
- Structured logs, sampling, and retention tiers are the main cost-control tools.
- Keep full fidelity for security, billing, and critical failures.
- Use metrics and traces to reduce dependence on verbose logs.
- Treat observability as an architecture decision, not an afterthought.
FAQ
Is log sampling safe for production systems?
Yes, if it is applied to repetitive, low-risk events and never to critical security, billing, or audit actions.
What logs should never be sampled?
Authentication events, payment state changes, security alerts, and regulated audit trails should usually be kept in full or handled under stricter rules.
How long should logs be retained?
It depends on business, security, and compliance needs. Keep critical logs longer and expire routine operational logs sooner.
Why are structured logs better than plain text?
They are easier to search, filter, and analyze, and they usually support better automation and lower operational friction.
Can APLINDO help us redesign our logging stack?
Yes. APLINDO can support SaaS engineering, observability design, applied AI use cases, and compliance-oriented architecture reviews for teams in Indonesia and beyond.

