Add newline to terminate timestamp. Move InputStream log to outside loop.