Skip to content

First version of logtap - #4

Merged
dwego merged 29 commits into
mainfrom
dev
Jul 18, 2026
Merged

First version of logtap#4
dwego merged 29 commits into
mainfrom
dev

Conversation

@dwego

@dwego dwego commented Jul 15, 2026

Copy link
Copy Markdown
Owner

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:

  • Added a Dockerfile to 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.
  • Introduced a .dockerignore file 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:

  • Added an Apache License 2.0 in the LICENSE file, clearly specifying the terms for use, reproduction, and distribution of the project.

Dependency and Build Optimization:

  • Updated Cargo.toml to add the toml and clap dependencies, and enabled release profile optimizations such as binary stripping and thin LTO for smaller, faster binaries.

Continuous Integration Workflow:

  • Modified the CI workflow in .github/workflows/ci.yml to run cargo 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:

  • Added a Dockerfile to support multi-stage Docker builds, enabling efficient containerized builds and deployments of the logtap binary. The Dockerfile separates dependency caching and source compilation for faster rebuilds and smaller runtime images.
  • Introduced a .dockerignore file 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:

  • Added an Apache License 2.0 as the project's license in the LICENSE file, clarifying terms for use, distribution, and contributions.

Dependency and Build Configuration:

  • Updated Cargo.toml to add the toml and clap dependencies, and enabled release optimizations (strip = true, lto = "thin") for smaller and faster binaries.

Continuous Integration:

  • Modified the CI workflow in .github/workflows/ci.yml to run cargo fmt (format code) instead of checking formatting, ensuring code is always formatted during CI runs.

menezes0067 and others added 26 commits July 14, 2026 23:48
feat: add notify instead of 500 ms polling
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
@dwego
dwego merged commit ad73f10 into main Jul 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants