Skip to content
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

redirect logs to files #320

Merged
merged 4 commits into from
Nov 13, 2024
Merged

redirect logs to files #320

merged 4 commits into from
Nov 13, 2024

Conversation

danangmassandy
Copy link
Collaborator

@danangmassandy danangmassandy commented Nov 12, 2024

This is for https://github.com/unicef-drp/GeoRepo/issues/1196

Changes:

  • Redis: Use redis.conf to redirect logs to file
  • Django: Modify uwsgi.conf to redirect logs to file
  • Worker/Celery Beat: Modify commands to redirect logs to file
  • Nginx: Modify nginx.conf to redirect access and error logs to files

A new mount volume tmp_data is created to host all logs from every containers. Then logrotate service will pick every log files under this directory and rotate the log files. The default configuration for logrotate:

  • keep 14 recent log files
  • rotate when size is over 100 MB
  • Interval to check is daily

I also added a django admin page to view all log files and download the file.
2024-11-12_16-23

@meomancer I'm not sure where to put the model, for now I put it under machine_info_fetcher. Feel free to update this PR.

@meomancer meomancer marked this pull request as ready for review November 13, 2024 03:24
@meomancer meomancer merged commit 158730d into main Nov 13, 2024
2 checks passed
@meomancer meomancer deleted the feat-log-to-disk branch November 19, 2024 00:44
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