From 3ba5ac45b69550983121ab20e825361c4e8efdd5 Mon Sep 17 00:00:00 2001 From: OSINT-TECHNOLOGIES <77023667+OSINT-TECHNOLOGIES@users.noreply.github.com> Date: Wed, 21 Aug 2024 20:13:25 +0300 Subject: [PATCH] Added logging for PS --- service/logs_processing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service/logs_processing.py b/service/logs_processing.py index 46cef73..74453dc 100644 --- a/service/logs_processing.py +++ b/service/logs_processing.py @@ -6,14 +6,14 @@ def create_log_folder(): os.makedirs(scan_logs_folder, exist_ok=True) return scan_logs_folder -def write_logs(ctime, whois_gather_status, contact_mail_gather_status, subdomains_gather_status, list_to_log, get_ssl_certificate_status, get_dns_info_status, get_sitemap_xml_status, extract_links_from_sitemap_status, get_robots_txt_status, get_technologies_status, query_internetdb_status): +def write_logs(ctime, whois_gather_status, contact_mail_gather_status, subdomains_gather_status, list_to_log, get_ssl_certificate_status, get_dns_info_status, get_sitemap_xml_status, extract_links_from_sitemap_status, get_robots_txt_status, get_technologies_status, query_internetdb_status, ps_to_log_list): to_log = [whois_gather_status, contact_mail_gather_status, subdomains_gather_status, get_ssl_certificate_status, get_dns_info_status, get_sitemap_xml_status, extract_links_from_sitemap_status, get_robots_txt_status, get_technologies_status, query_internetdb_status] subdomains_processes_logs = [item for sublist in list_to_log for item in sublist] scan_logs_folder = create_log_folder() log_file_name = f"scan_log_{ctime}.log" logging.basicConfig(level=logging.INFO, filename=scan_logs_folder + "// " + log_file_name, filemode="w", format="%(asctime)s %(message)s") logging.info("# THIS FILE REPRESENTS DPULSE SCAN LOGS\n") - print(Fore.GREEN + "Created log file for this scan" + Style.RESET_ALL) + print(Fore.GREEN + f"Created {log_file_name} log file for this scan" + Style.RESET_ALL) for log in to_log: logging.info(log) @@ -21,5 +21,8 @@ def write_logs(ctime, whois_gather_status, contact_mail_gather_status, subdomain for log in subdomains_processes_logs: logging.info(log) + for log in ps_to_log_list: + logging.info(log) + logging.shutdown() return log_file_name