Skip to content

Commit

Permalink
UID2-3315 update logging destination (#565)
Browse files Browse the repository at this point in the history
* Change log name

* Add crontab script

* Copy crontab script in action

* Use logrotate instead of modifying crontab

* Add 0minutely file to run cronjob minutely

* Use custom branch for testing

* Run logrotate from the script

* Renmae 0minutely to logrotate

* Rename syslog-ng logs to operator.log

* Change branch back to main
  • Loading branch information
cYKatherine authored May 16, 2024
1 parent 7037d6e commit ce3b04f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions scripts/aws/logrotate/logrotate
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/sh

/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
# Run the minutely jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
* * * * * root /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
2 changes: 1 addition & 1 deletion scripts/aws/logrotate/operator-logrotate.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/var/log/operator-ip-*.log
/var/log/operator.log
{
rotate 30
daily
Expand Down
2 changes: 1 addition & 1 deletion scripts/aws/syslog-ng/syslog-ng-server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ source s_network {

destination d_file {
file(
"/var/log/${LOGHOST}.log"
"/var/log/operator.log"
dir-perm(0755)
template-escape(no));
};
Expand Down

0 comments on commit ce3b04f

Please sign in to comment.