Redirecting Build Output to Console for Automated Builds

I am trying to run automated Unity (Version 4.5.5f1) builds through a Jenkins server. So far, I’ve been able to specify the log output location of the build using the following command:

Unity.exe -batchmode -quit -logFile %WORKSPACE%\Build\Build.log ...

This puts the log file into the build directory. However, I want to have the Unity build log show up as part of the Jenkins build log for easier troubleshooting. The Jenkins build log is created from the console output of the task.

How can I do this?

Simply add the parameter -logfile to the console command (without appending an actual log file name). This will make Unity print all log output to stdout. This article explains it: Loading... (it’s actually about TeamCity but the same principles apply for Jenkins as well).

In more recent versions of Unity (2020.2+) use the logfile command with a hyphen as the output location -logfile - to capture the build logs in Jenkins

Is this still working for people? I have “-logfile” (no file name) but get no output to the console… Thanks!

Reproduced this issue with -logfile and no parameters on 2017.4.6. Seems fixed in 2018.1 Unity Issue Tracker - Command line -logFile with no parameters outputs to screen on OS X but not on Windows

This was the workaround used:
-logfile 2>&1 > ${projectDir}/Editor.log

Is there any way to output the log when using any CI system like jenkins pipeline?