mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-21 05:10:57 +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.
|
# Once we finally stop getting duplicate logs output the number of times we got a duplicate.
|
||||||
if [[ $logrepeat -gt 1 ]];then
|
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
|
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
|
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
|
if [[ ${levels[$log_priority]} -ge ${levels[$LOGGING]} ]]; then
|
||||||
while IFS= read -r logmessage; do
|
while IFS= read -r logmessage; do
|
||||||
if [[ "$(whoami)" == "root" ]]; then
|
if [[ "$(whoami)" == "root" ]]; then
|
||||||
echo "$timestamp" : "${log_priority} : ${logmessage}" | tee -a $log_location
|
echo "$timestamp" : "${log_priority} : $label : ${logmessage}" | tee -a $log_location
|
||||||
else
|
else
|
||||||
echo "$timestamp" : "${log_priority} : ${logmessage}"
|
echo "$timestamp" : "${log_priority} : $label : ${logmessage}"
|
||||||
fi
|
fi
|
||||||
done <<< "$log_message"
|
done <<< "$log_message"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user