added file logging option