You can create a script and inside it make an API call , such as :
get-logs.sh
echo "Getting logs job from ${TRAVIS_JOB_ID}"
REQUEST_RESULT=$(curl -s -X GET \
-H "Travis-API-Version: 3" \
-H "Accept: text/plain" \
-H "Authorization: token ${TOKEN}" \
https://api.travis-ci.org/api/job/${TRAVIS_JOB_ID}/log)
echo " * request result:"
echo "${REQUEST_RESULT}"
then call the script later: sh get-logs.sh > travisLogs.log
${TOKEN}
is the token you have for your travis repository. https://blog.travis-ci.com/2013-01-28-token-token-token
${TRAVIS_JOB_ID}
the id of the job, this is a travis variable too, so if this is inside a .travis.yml
it will get the current job Id.
Ref: https://developer.travis-ci.org/resource/log#Log