use ios::out instead of ios::app to open logfiles