Skip to content

NGINX has to be restarted after sys internal log rotation feature #351

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

Open
akama-aka opened this issue Apr 18, 2025 · 2 comments
Open

NGINX has to be restarted after sys internal log rotation feature #351

akama-aka opened this issue Apr 18, 2025 · 2 comments

Comments

@akama-aka
Copy link

Hello,

I have noticed that if you use the build-in log rotation of Linux

Reference:

[akama.aka@dc-eu-ger-fra-001 ~]$ cat /etc/logrotate.conf 
# see "man logrotate" for details

# global options do not affect preceding include directives

# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# system-specific logs may be also be configured here.


/var/log/modsec_audit.log {
	compress
	daily
	missingok
	rotate 366
}

that the nginx server must be restarted so that it continues to be logged into the /var/log/modsec_audit.log file. Otherwise everything remains empty and it is written to the nginx own error log file.

I've created a crontab that restarts the nginx Server one minute after 12am.

@airween
Copy link
Member

airween commented Apr 18, 2025

Hi @akama-aka,

thanks for reporting this. I marked this issue as duplicated, because there are some other similar issues.

Note, that there is a possible fix, see #198, but it seems like that's unfinished.

@akama-aka
Copy link
Author

Hi @akama-aka,

thanks for reporting this. I marked this issue as duplicated, because there are some other similar issues.

Note, that there is a possible fix, see #198, but it seems like that's unfinished.

Oh okay sorry o.o. thank you for letting me know. ;3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants