Console Application - Echo To Log

Hey, I need some help with logging. I have a console application script that is going to run as a cron job. Right now, for testing, I have been using CMD to execute the script and I have been outputting messages with "echo", so I can see what is going on.

Now, I want to put all those messages to a log file. Do I need to change all those “echo ‘message’;” to "Yii::log(‘message’), or can I automatically route echos to the log file? Thanks.

1 Like