Add file-based logging for worker, scheduler, and monitor services - #418
Open
yarikoptic-gitmate wants to merge 1 commit into
Open
yarikoptic-gitmate wants to merge 1 commit into
yarikoptic-gitmate wants to merge 1 commit into
Conversation
The worker, scheduler, and monitor (Flower) services logged to stdout/stderr, which container runtimes commonly capture into the systemd journal (Podman's default log driver when run under systemd cgroups). Since the worker logs the outcome of every Celery task at INFO level, this flooded journalctl output on deployed instances. Point these services at logfiles under a new LOG_PATH_AT_HOST-mounted directory instead, and document log rotation (copytruncate, since the files are held open by long-running processes) with a sample logrotate config. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0127zpCF6N24jrkd9JoSBUDe
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #418 +/- ##
=======================================
Coverage 98.82% 98.82%
=======================================
Files 55 55
Lines 2633 2633
=======================================
Hits 2602 2602
Misses 31 31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
This PR adds file-based logging for the worker, scheduler, and monitor (Flower) services in Datalad-Registry. Instead of relying on the container runtime to capture logs (e.g., to the systemd journal), these services now write their logs to files on the host, reducing noise in the container runtime's logging system.
Key Changes
docker-compose.yml: Updated worker, scheduler, and monitor service commands to write logs to files under
/var/log/datalad-registryinside containers--logfile /var/log/datalad-registry/worker.log--logfile /var/log/datalad-registry/scheduler.log--log_file_prefix=/var/log/datalad-registry/monitor.logLOG_PATH_AT_HOSTto all three servicestemplate.env: Added new
LOG_PATH_AT_HOSTenvironment variable (defaults to./services/log) to specify the host directory where log files are writtenREADME.md: Added comprehensive "Logs" section documenting:
tools/logrotate-datalad-registry: Added example logrotate configuration file with installation instructions, using
copytruncateto handle long-running container processesImplementation Details
The logging setup uses
copytruncatein the logrotate configuration rather than the default rotate-then-signal approach, because the log files are held open by long-running processes inside containers that logrotate on the host cannot directly signal. This is a common pattern for containerized applications.The changes are backward compatible—the
LOG_PATH_AT_HOSTenvironment variable can be configured to any desired location, and the volume mounts ensure logs are accessible on the host for monitoring and archival purposes.https://claude.ai/code/session_0127zpCF6N24jrkd9JoSBUDe