'Collect all the microservice log files.'

def collect_logs(self):

    log_dir = os.path.join(self.options.log_dir, 'service_logs')
    if (not os.path.exists(log_dir)):
        os.makedirs(log_dir)
    def fetch_service_log(service):
        try:
            logging.debug('Fetching    logs    for    "%s"...', service)
            deployer = (self if (service in HALYARD_SERVICES) else self.__spinnaker_deployer)
            deployer.do_fetch_service_log_file(service, log_dir)
        except Exception as ex:
            message = 'Error    fetching    log    for    service    "{service}":    {ex}'.format(service=service, ex=ex)
            if (ex.message.find('No    such    file') >= 0):
                message += '\n                Perhaps    the    service    never    started.'
            else:
                logging.error(message)
                message += '\n{trace}'.format(trace=traceback.format_exc())
            write_data_to_secure_path(message, os.path.join(log_dir, (service + '.log')))
    logging.info('Collecting    server    log    files    into    "%s"', log_dir)
    all_services = list(SPINNAKER_SERVICES)
    all_services.extend(HALYARD_SERVICES)
    thread_pool = ThreadPool(len(all_services))
    thread_pool.map(fetch_service_log, all_services)
    thread_pool.terminate()
