'Creates a logger that will persist incomming queries and their results.'

@staticmethod
def _create_query_logger(response_log_dir):

    if response_log_dir:
        timestamp = datetime.datetime.now().strftime(u'%Y%m%d-%H%M%S')
        log_file_name = u'rasa_nlu_log-{}-{}.log'.format(timestamp, os.getpid())
        response_logfile = os.path.join(response_log_dir, log_file_name)
        utils.create_dir_for_file(response_logfile)
        query_logger = Logger(observer=jsonFileLogObserver(io.open(response_logfile, u'a', encoding=u'utf8')), namespace=u'query-logger')
        logger.info(u"Logging    requests    to    '{}'.".format(response_logfile))
        return query_logger
    else:
        logger.info(u"Logging    of    requests    is    disabled.    (No    'request_log'    directory    configured)")
        return None
