Handling API exceptions in Rasa action server

Hi,

Could you please suggest, how to track information, errors in a logger? I a using the below codes in my action file but it’s not capturing anything, neither any log files created as of now. (its also not showing any error.

import logging
logging.basicConfig(filename='logfile.log', format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
logger = logging.getLogger(__name__)


def submit(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict]:
	
	 try:
	........
	........
	........

except Exception as e:
            msg = 'Unfortunately I am not able to extract requested information! <br>You can still contact us via email 🙂'
            dispatcher.utter_message(text= msg)
            logger.error(e)
            # logger.exception()
            logger.exception("Failed to extract data for " + project + "(" + query + ")")
            return []

Will appreciate your response.