Conversation
Feat/filter sink
feat: implement source tail
feat: add notify instead of 500 ms polling
feat: add sink backoff
feat: add dead-letter when reach max retries
Multi-stage build (rust:slim -> debian:slim, non-root user), relying on reqwest's bundled webpki-roots so no ca-certificates package is needed at runtime. Also tunes the release profile (strip, thin LTO) since the resulting binary size now matters for image size.
README's Getting started still described a library-only workflow with no CLI binary, which is out of date now that main.rs and the Dockerfile exist. Replaces it with the actual build/run steps, exit codes, Docker usage, and the full current config field reference (retry/backoff, mask_common_patterns, dead-letter rotation). Also documents the manual dead-letter replay recipe and checks off the roadmap items that are now actually done. Fills in the previously-empty root logtap.toml with a working example.
feat: create the first version of logtap cli
source now compares the inode at source_path against the one it has open on every 200ms tick. On a mismatch (standard logrotate rename-then-create behavior), it drains whatever was left in the old file, reopens the new one from the start, and re-registers the notify watcher — otherwise it stays bound to the old, now-orphaned inode. Doesn't yet handle copytruncate-style rotation (same inode, truncated in place).
New tests/stress_test.rs — a separate category from the per-function correctness tests elsewhere in this directory, meant for tests that exercise the full pipeline under load/failure conditions rather than one function in isolation. Sends a burst of logs well beyond channel_capacity while the sink's destination is unreachable for the whole test, and asserts the dead-letter file ends up with exactly what was written — no loss, no duplicates — after every batch exhausts its retries.
Checks off log rotation and the channel-boundedness criterion (the latter proven by construction plus the new stress test rather than direct memory measurement), and explicitly notes config validation and metrics as deferred to v1.1 rather than leaving them as unexplained open checkboxes. Also documents the tests/ layout now that stress_test.rs exists as its own category.
feat: detect log rotation and reopen the rotated file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several foundational improvements to the project, focusing on build and deployment infrastructure, dependency management, and licensing. The most significant changes are the addition of
This pull request introduces several foundational changes to the project, including the addition of a Docker build and runtime environment, adoption of the Apache 2.0 license, and improvements to dependency management and CI workflows. These updates help standardize the development environment, clarify licensing, and optimize builds for production.
Dockerization and Environment Setup:
Dockerfileto enable multi-stage Docker builds, separating dependency caching, build, and runtime stages for efficient and reproducible containerized deployments. The runtime image uses a non-root user and expects configuration to be mounted at runtime..dockerignorefile to exclude unnecessary files and directories (such as build artifacts, version control data, IDE settings, test directories, and logs) from Docker build context, reducing image size and build times.Licensing:
Apache License 2.0in theLICENSEfile, clearly specifying the terms for use, reproduction, and distribution of the project.Dependency and Build Optimization:
Cargo.tomlto add thetomlandclapdependencies, and enabled release profile optimizations such as binary stripping and thin LTO for smaller, faster binaries.Continuous Integration Workflow:
.github/workflows/ci.ymlto runcargo fmt(formatting code in-place) instead of checking formatting, ensuring code is always auto-formatted in CI runs. support for building and running the application, the introduction of a formal open-source license, and enhancements to the project's dependency and build configuration.Build and Deployment Infrastructure:
Dockerfileto support multi-stage Docker builds, enabling efficient containerized builds and deployments of thelogtapbinary. The Dockerfile separates dependency caching and source compilation for faster rebuilds and smaller runtime images..dockerignorefile to exclude unnecessary files and directories (such as build artifacts, git metadata, editor configs, logs, and tests) from Docker build contexts, reducing image size and build times.Licensing:
Apache License 2.0as the project's license in theLICENSEfile, clarifying terms for use, distribution, and contributions.Dependency and Build Configuration:
Cargo.tomlto add thetomlandclapdependencies, and enabled release optimizations (strip = true,lto = "thin") for smaller and faster binaries.Continuous Integration:
.github/workflows/ci.ymlto runcargo fmt(format code) instead of checking formatting, ensuring code is always formatted during CI runs.