Skip to content

Commit

Permalink
feat: changed logging and logrotate behavior (#79)
Browse files Browse the repository at this point in the history
Disabled logging for 'webcam*' nginx proxy
Changed nginx logrotate 'rotate' from 14 to 2
Changed webcamd logging, rotate 2 and limit to 32M
Changed rsyslog logrotate 'rotate' from 4 to 2
and limit from 256M to 128M and daily instead of weekly

Signed-off-by: Stephan Wendel <me@stephanwe.de>
  • Loading branch information
KwadFan authored Jan 19, 2022
1 parent 67ae0d4 commit 83988ea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/modules/mainsail/filesystem/root/etc/logrotate.d/rsyslog
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/var/log/syslog
{
rotate 4
rotate 2
daily
maxsize 256M
maxsize 128M
missingok
notifempty
delaycompress
Expand All @@ -25,9 +25,9 @@
/var/log/debug
/var/log/messages
{
rotate 4
weekly
maxsize 256M
rotate 2
daily
maxsize 128M
missingok
notifempty
compress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,25 @@ server {

location /webcam/ {
proxy_pass http://mjpgstreamer1/;
access_log off;
error_log off;
}

location /webcam2/ {
proxy_pass http://mjpgstreamer2/;
access_log off;
error_log off;
}

location /webcam3/ {
access_log off;
error_log off;
proxy_pass http://mjpgstreamer3/;
}

location /webcam4/ {
access_log off;
error_log off;
proxy_pass http://mjpgstreamer4/;
}
}
3 changes: 3 additions & 0 deletions src/modules/mainsail/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ apt update && apt install ${MAINSAIL_DEPS} -y
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/

# lower nginx rotate cycle to 2 instead 14
sudo sed -i 's/rotate 14/rotate 2/' /etc/logrotate.d/nginx

### Download and Install Mainsail Web Frontend
pushd /home/${BASE_USER}
sudo -u ${BASE_USER} wget -q --show-progress -O mainsail.zip "${MAINSAIL_URL}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

/var/log/webcamd.log
{
rotate 4
rotate 2
weekly
maxsize 64M
maxsize 32M
missingok
notifempty
compress
Expand Down

0 comments on commit 83988ea

Please sign in to comment.