The custom log handler — receives billing.events records, batches them off the request path, and flushes .jsonl files to S3 using its own overflow policy.
What to do
Add BillingS3LogHandler extends java.util.logging.Handler:
Acceptance
- Unit tests: thresholds seal a batch; full buffer drops + increments the counter;
close() drains the remainder; uploader invoked with the expected key + content.
The custom log handler — receives
billing.eventsrecords, batches them off the request path, and flushes.jsonlfiles to S3 using its own overflow policy.What to do
Add
BillingS3LogHandler extends java.util.logging.Handler:publish(LogRecord): extract the message, enqueue into an own bounded buffer; non-blocking, never throws; on full → drop + Micrometer counter.flush()/close(): drain remaining batches (used on graceful shutdown).Acceptance
close()drains the remainder; uploader invoked with the expected key + content.