Skip to content

Monitoring glossary

What is log optimization?

Most log bills are driven by a few noisy sources. Find them, cut what nobody reads, and keep what helps during incidents.

3 min read8 sectionsUpdated

On this page

Key points

  • Measure first: volume by service, level and message pattern.
  • A few patterns usually make up most of the volume.
  • Sample, do not delete, for high-volume informational logs.
  • Shorter retention for detail, longer for audit.

Find the noise

Group last week's logs by service, level and normalized message. Typical top offenders: health-check access logs, per-request debug lines left on, retries logging the same error thousands of times, and verbose third-party libraries.

Actions, in order of impact

ActionEffect
Drop health-check and probe logsOften a large share of access logs gone
Turn off debug in productionRemoves the most verbose level
Log errors once, where handledStops duplicate stack traces
Sample repetitive info logsKeeps the pattern, cuts the volume
Structure fields, shorten messagesSmaller lines, faster search
Tier retention by typeDetail for days, audit for months
Set daily capsA runaway service cannot explode the bill

Keep what you need in incidents

Before cutting, check recent postmortems: which logs did responders use? Keep error and warning logs with context, logs that carry trace IDs, and audit logs. Prefer metrics for counting things (requests per second), and traces for per-request detail; logs are the most expensive way to count.

In VitalRix

Usage controls show logs ingested per day in bytes, let you set a daily cap in GB with warnings at 80% and 100%, and shorten retention below your plan's maximum. Logs that carry trace IDs link to their traces, so you can log less and still find the detail. See log levels and log retention policy.

Frequently asked questions

Will sampling hide errors?

Sample informational logs only. Keep all errors and warnings.

Should I convert logs to metrics?

For counting and alerting, yes. Metrics are far cheaper than storing every line to count it later.

  • What is log aggregation?: Log aggregation explained: collecting logs from every server and container into one searchable place, the pipeline, structured logs, cost control and retention.
  • Log management: Centralized log management: send structured logs over HTTPS, search and filter them, watch them live, parse with pipelines and open the trace behind a line.
  • What is alert flapping?: Alert flapping explained: why alerts fire and resolve over and over, and the fixes that work: sustained conditions, hysteresis, cooldowns and grouping.
  • How to reduce First Contentful Paint (FCP): Reduce First Contentful Paint: lower TTFB, remove render-blocking CSS and scripts, load fonts sensibly and measure improvements with real-user data.
  • Elasticsearch vs Grafana Loki: Elasticsearch (ELK) vs Grafana Loki for logs: full-text indexing against label-based storage, cost, query speed, operations effort and when each fits.
  • How to fix CLS (Cumulative Layout Shift): Fix Cumulative Layout Shift: reserve space for images, ads and embeds, tame web fonts, avoid injected banners and animate safely, with code to copy.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.