feat(aio): add log rotation in preview server
This commit is contained in:
parent
092f0df7a6
commit
c0b1bbea3e
|
@ -79,6 +79,11 @@ RUN apt-get update -y && apt-get install -y \
|
||||||
RUN yarn global add pm2@2
|
RUN yarn global add pm2@2
|
||||||
|
|
||||||
|
|
||||||
|
# Set up log rotation
|
||||||
|
COPY logrotate/* /etc/logrotate.d/
|
||||||
|
RUN chmod 0644 /etc/logrotate.d/*
|
||||||
|
|
||||||
|
|
||||||
# Set up cronjobs
|
# Set up cronjobs
|
||||||
COPY cronjobs/aio-builds-cleanup /etc/cron.d/
|
COPY cronjobs/aio-builds-cleanup /etc/cron.d/
|
||||||
RUN chmod 0744 /etc/cron.d/aio-builds-cleanup
|
RUN chmod 0744 /etc/cron.d/aio-builds-cleanup
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/var/log/aio/clean-up.log /var/log/aio/init.log /var/log/aio/verify-setup.log {
|
||||||
|
compress
|
||||||
|
create
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
monthly
|
||||||
|
notifempty
|
||||||
|
rotate 6
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
/var/log/aio/nginx/*.log /var/log/aio/nginx-test/*.log {
|
||||||
|
compress
|
||||||
|
create
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
monthly
|
||||||
|
notifempty
|
||||||
|
rotate 6
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
service nginx rotate >/dev/null 2>&1
|
||||||
|
endscript
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
/var/log/aio/upload-server-*.log {
|
||||||
|
compress
|
||||||
|
copytruncate
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
monthly
|
||||||
|
notifempty
|
||||||
|
rotate 6
|
||||||
|
}
|
|
@ -41,9 +41,10 @@ certificate covering both the domain and subdomains.
|
||||||
## Create directory for logs (Optional)
|
## Create directory for logs (Optional)
|
||||||
Optionally, a logs directory can pe passed to the docker container for storing non-system-related
|
Optionally, a logs directory can pe passed to the docker container for storing non-system-related
|
||||||
logs. If not provided, the logs are kept locally on the container and will be lost whenever the
|
logs. If not provided, the logs are kept locally on the container and will be lost whenever the
|
||||||
container is replaced (e.g. when updating to use a newer version of the docker image).
|
container is replaced (e.g. when updating to use a newer version of the docker image). Log files are
|
||||||
|
rotated and retained for 6 months.
|
||||||
|
|
||||||
The following files log files are kept in this directory:
|
The following log files are kept in this directory:
|
||||||
|
|
||||||
- `clean-up.log`:
|
- `clean-up.log`:
|
||||||
Output of the `aio-clean-up` command, run as a cronjob for cleaning up the build artifacts of
|
Output of the `aio-clean-up` command, run as a cronjob for cleaning up the build artifacts of
|
||||||
|
|
Loading…
Reference in New Issue