Skip to content

fix: Configured Apache log rotation in docker deployment scenario #11782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

JagjeevanAK
Copy link
Contributor

Signed-off-by: Jagjeevan Kashid [email protected]

What

Implemented a log-rotation according to described solution by @alexgarel in the issue

I would suggest maintainer to change the config file of logrotate according to there need current setting keep 14 rotated logs (i.e., 2 weeks) and other things.

Related issue(s) and discussion

@JagjeevanAK JagjeevanAK requested a review from a team as a code owner April 14, 2025 10:14
@github-actions github-actions bot added the 🐋 Docker https://docker-curriculum.com/ label Apr 14, 2025
@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 14, 2025
Copy link

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.05%. Comparing base (e8deee5) to head (40aeac3).
Report is 91 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11782      +/-   ##
==========================================
+ Coverage   49.88%   50.05%   +0.16%     
==========================================
  Files          83       84       +1     
  Lines       22984    23110     +126     
  Branches     5508     5531      +23     
==========================================
+ Hits        11466    11568     +102     
- Misses      10121    10125       +4     
- Partials     1397     1417      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is not used in docker. It's for production only (proxmox containers).
It's not *.log but *log on purpose and it have to work for all flavors.

So never touch this for docker.

Comment on lines +203 to +204
RUN echo "0 0 * * * /usr/sbin/logrotate /etc/logrotate.conf" > /etc/cron.d/logrotate && \
chmod 0644 /etc/cron.d/logrotate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work as there is no cron daemon in docker containers (and that's better)

That's why I was expecting either to use an external cron (on docker staging VM) or to have Apache rotate it's log by itself (this is a capability found in some logging framework, I don't know if it's the case for apache2.

The first option means you might not be able to resolve this issue, but in the -infrastructure repository, and with a manual deployment.

@github-project-automation github-project-automation bot moved this from To discuss and validate to In Progress in 🍊 Open Food Facts Server issues Apr 15, 2025
@alexgarel
Copy link
Member

@JagjeevanAK I'm closing this PR as I think there is no good way to do this here.

@JagjeevanAK
Copy link
Contributor Author

100% you are correct I was about to say this thing but forgot to mention on this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐋 Docker https://docker-curriculum.com/
Projects
Development

Successfully merging this pull request may close these issues.

Configure Apache log rotation in docker deployment scenario
3 participants