flatten logs