HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMajor

How can we get the jenkins console output in a text file?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
canthefilejenkinstextoutputgethowconsole

Problem

How can i get the Jenkins console output in a text file?
I want to share it with someone, is there any way to do it?

Solution

if you want just access the log and download it as a txt file to your workspace from the job's URL:

${BUILD_URL}/consoleText


On Linux, you can use wget to download it to your workspace

wget ${BUILD_URL}/consoleText


The actual log file on the file system is in the Master machine. You can find it under:

$JENKINS_HOME/jobs/$JOB_NAME/builds/lastSuccessfulBuild/log

Code Snippets

${BUILD_URL}/consoleText
wget ${BUILD_URL}/consoleText

Context

StackExchange DevOps Q#6085, answer score: 41

Revisions (0)

No revisions yet.