move collect_logs to common-functions.sh