mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Label on each log line (again)
This commit is contained in:
@@ -114,7 +114,7 @@ printlog(){
|
||||
|
||||
# Once we finally stop getting duplicate logs output the number of times we got a duplicate.
|
||||
if [[ $logrepeat -gt 1 ]];then
|
||||
echo "$timestamp" : "${log_priority} : Last Log repeated ${logrepeat} times" | tee -a $log_location
|
||||
echo "$timestamp" : "${log_priority} : $label : Last Log repeated ${logrepeat} times" | tee -a $log_location
|
||||
|
||||
if [[ ! -z $datadogAPI ]]; then
|
||||
curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : $APPLICATION : $VERSION : $SESSION : Last Log repeated ${logrepeat} times" > /dev/null
|
||||
@@ -134,9 +134,9 @@ printlog(){
|
||||
if [[ ${levels[$log_priority]} -ge ${levels[$LOGGING]} ]]; then
|
||||
while IFS= read -r logmessage; do
|
||||
if [[ "$(whoami)" == "root" ]]; then
|
||||
echo "$timestamp" : "${log_priority} : ${logmessage}" | tee -a $log_location
|
||||
echo "$timestamp" : "${log_priority} : $label : ${logmessage}" | tee -a $log_location
|
||||
else
|
||||
echo "$timestamp" : "${log_priority} : ${logmessage}"
|
||||
echo "$timestamp" : "${log_priority} : $label : ${logmessage}"
|
||||
fi
|
||||
done <<< "$log_message"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user