I know that I can log to file by adding
to the end of a command but how can I log to file AND to console?
There are various ways by which you can make log. But the first and the foremost thing is what actually you want to put in your log. You can do that in various ways: