In Linux, I know how to write a simply message to the /var/log/messages
file, in a simple shell script I created:
#!/bin/bash
logger \"have fun!\"
<
There's good amount of detail on logging for shell scripts via global varaibles of shell. We can emulate the similar kind of logging in shell script: http://www.cubicrace.com/2016/03/efficient-logging-mechnism-in-shell.html The post has details on introdducing log levels like INFO , DEBUG, ERROR. Tracing details like script entry, script exit, function entry, function exit.
Sample Log: