Cut your log bill by finding the noisiest lines

Find the kinds of log line that cost the most across your sources, fix the loud ones in your Laravel app, and drop or sample the rest in a click.

Beginner10 min to complete4 min read

Before you start

  • A Tailcove source receiving logs for a few days
  • An owner or admin role on the team to drop or sample

Most of a log bill comes from a handful of lines nobody reads: a health check every few seconds, a cache hit on every request, a debug line someone forgot. Tailcove bills per GB ingested, so finding those few lines is the quickest way to pay less. This guide uses the Log costs page to find them, then fixes them in the app where you can and with a rule where you can't.

On this page4 sections

1. Open Log costs#

Click Log costs in the sidebar. It lists the 50 kinds of line that took the most room across every source you can see, biggest first, over the last 7 days.

Each row is one pattern: lines that differ only in their numbers, ids and quoted text. So these two are one row:

GET /health 200 in 3ms
GET /health 200 in 12ms

Look at three columns. Stored is how much room the pattern took in the window and its share of everything. A month scales that to 30 days. Dropping it saves turns it into money if your month is heading past the plan's included GB on Pro or Business, or into a share of the included GB if it isn't.

In a typical Laravel app the top of the list looks something like this:

Pattern Stored A month
GET /health <num> in <num>ms 31% 4.1 GB
Cache hit: <str> 18% 2.4 GB
select * from <str> where <str> = <num> 9% 1.2 GB

The sizes are what we store for each line, which is close to what billing counts but not the same. Use them to rank, then check the Billing page for the real usage.

2. Fix what you can in the app#

A line that's never sent costs nothing and needs no rule. Before you drop anything, ask whether the app should write it at all.

  • Debug left on. If rows at debug level top the list, production is probably running with LOG_LEVEL=debug. Set it to info or warning in .env and run php artisan config:cache.
  • Health checks. Log the check only when it fails. In a Laravel health route, return early on success without a Log::info() call.
  • Query logging. DB::listen() writing every query is handy locally and very expensive in production. Wrap it in if (app()->isLocal()).

Deploy, wait a day, and switch the window to 24h. The row should be gone or much smaller.

3. Drop or sample the rest#

Some noise comes from code you don't control: a vendor package, a proxy, a framework warning you've already read a thousand times. For those, use the buttons on the row.

Drop stops storing the pattern. Its lines are discarded at the door, before they're counted, so they don't use your quota.

Keep 1 in N stores a share and drops the rest: 1 in 10 keeps 10%, 1 in 100 keeps 1%. It's a good fit for lines you want to see now and then, such as a slow-ish request that's usually fine. The same lines are kept if a client retries a batch, so a retry doesn't change the sample.

Both are ordinary transform rules on the source. They count against your plan's rules per source (3 on Free, 15 on Pro, 50 on Business), and the page says so when a source is full.

Don't drop error patterns without reading a few of their lines first. The row's source link opens its Patterns tab, where the pattern's lines are one click away.

4. Check it worked, and undo if you need to#

Dropped and sampled patterns appear under Already cut, with the source and the rule. If you dropped something you need after all, press Undo: lines of that pattern are stored again from then on. Lines dropped in the meantime don't come back.

A week later, open the Billing numbers again. This month, projected at the top of Log costs should be lower, and if you were over your included GB, the overage on the next invoice goes down with it.

Ready to try it on your own logs?

The Free plan includes a source, live tail, search and alerts. No credit card.