Skip to content

Instantly share code, notes, and snippets.

@wjz1095
Last active September 28, 2021 16:11
Show Gist options
  • Save wjz1095/2fd2527b554836a59d322d90a1a65b2c to your computer and use it in GitHub Desktop.
Save wjz1095/2fd2527b554836a59d322d90a1a65b2c to your computer and use it in GitHub Desktop.
Bash Logging
LOGLOCATION="/var/log/example.log"
DATE=$(date)
MESSAGE="Your message here"
echo $DATE $MESSAGE >> $LOGLOCATION
echo "----------------------------" >> $LOGLOCATION
$LOGLOCATION="/var/log/example.log"
echo "" >> $LOGLOCATION
date >> $LOGLOCATION
echo "-----MESSAGE HERE-----" >> $LOGLOCATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment