File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -79,23 +79,21 @@ function send_slack_message() {
7979 . alerts/slack.sh " $1 "
8080}
8181
82- LOG_DIR_PATH=" ./alerts/notification_logs/log_$date_only .txt"
8382# Creates a log entry in the daily log file
8483function create_log_entry() {
8584 status=" $1 "
8685 reason=" ${2:- } "
8786
8887 timestamp=$( date +" %Y-%m-%d %H:%M:%S" )
8988
90- # Keep the date to get the file name
91- date_only=$( date +" %Y_%m_%d" )
89+ log_file_path=" ./alerts/notification_logs/log_$( date +" %Y_%m_%d" ) .txt"
9290
9391 # Check if file exists, if not create it
94- if [ ! -f " $LOG_DIR_PATH " ]; then
95- touch " $LOG_DIR_PATH "
92+ if [ ! -f " $log_file_path " ]; then
93+ touch " $log_file_path "
9694 fi
9795
98- echo " [$timestamp ] $status : - $reason " >> " $LOG_DIR_PATH "
96+ echo " [$timestamp ] $status : - $reason " >> " $log_file_path "
9997}
10098
10199# ################ SEND LOGIC #################
You can’t perform that action at this time.
0 commit comments