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

Logs for nginx under /config/log/nginx #713

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tcely
Copy link
Contributor

@tcely tcely commented Feb 11, 2025

For #70

This does quick and dirty rotation of the nginx directory.

This is needed because of the earlier ownership / permissions changes not accounting for the web server user.

Also, the logs won't grow forever; which is nice.
The error log contains informational and higher levels on the theory that when something goes wrong we will want as much information as we can get about why an error occurred.

Access log is compressed, in memory, then written to disk every minute. Most people will take about that long to start reading the file anyway.
@tcely tcely marked this pull request as ready for review February 11, 2025 21:38
@meeb
Copy link
Owner

meeb commented Feb 12, 2025

Doesn't this break HTTP request logging for the container in general? As in, removes it from the standard stdout and writes it to disk? Also unless I've missed it this doesn't have any log rotation by default?

@tcely
Copy link
Contributor Author

tcely commented Feb 12, 2025

Doesn't this break HTTP request logging for the container in general? As in, removes it from the standard stdout and writes it to disk?

Removing the access log from stdout was the intention here. I wouldn't call that broken.

Also unless I've missed it this doesn't have any log rotation by default?

The rotation is happening before starting nginx, so if you leave it running for long enough you could have lots of logs in a single file. However, access logs compress extremely well.

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