Added logging to syslog and console when stdout is a tty