switching on and off logging in log enabled file