main with log