Made file logger optional. Moved logging logic for responses.