added stdout logging option