linux log output of command to file code example
Example 1: linux show log file real time
$ sudo tail -f /var/log/apache2/access.log
Example 2: output to log file bash
#!/bin/bash
echo "This logs to where I want, but using echo" > /var/log/mycustomlog
OR
#!/bin/bash
echo "I will just append to my custom log file" >> /var/log/customlog