Make logging to file optional