Log sampling, because volume is a line on an invoice

Logging every request at info level produces a volume nobody reads and a bill somebody notices, and the useful lines are a small fraction of it.

// keep everything that failed; sample the rest
if ($response->getStatusCode() >= 400 || random_int(1, 100) === 1) {
    Log::channel('access')->info('request.completed', $context);
}

// and record the sampling rate, so the count can be corrected
$context['sample_rate'] = 100;

Recording the rate in the record is what keeps aggregate counts usable: a dashboard multiplying by the rate reports a real number, and one that does not silently under-reports by two orders of magnitude. Sampling by trace or session rather than per line keeps a whole request together, which is what makes a sampled log still readable during an investigation. Never sampling errors is the rule that makes any of this acceptable.