output to log file bash

C++
#!/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
Source

Also in C++: