Added log and log ouput managment