Ravi Sir's Cards › AWS
Script logging
This revision card explains Script logging. A log function. It describes to syslog with a tag. The how-to section notes error priority. An example on the card is read by tag.
Read card text
What this card says
Why do we need it?
A log function.
log(){ echo "$(date +%T) $*" >&2; }
What is it?
To syslog with a tag.
logger -t backup done
How to do it
Error priority.
logger -p user.err -t backup fail
Example
Read by tag.
journalctl -t backup