Mostly all need to log long running console apps or any other windows services,usually using extra third party but not customizable,here a simple way which gives all flexibility.
Just take the code & run...you will understand easily everything & extend whatever the way you wanted
Below output is produced from same code.