Made log to file optional