Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by $$anonymous$$ · Jan 23, 2015 at 09:25 PM · buildlogbatch

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?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yoyo · Jul 30, 2015 at 07:17 PM 0
Share

You can deploy the log file as a build artifact, which gives you some visibility via Jenkins. You can also write a file monitoring process to read the log file as it's written and echo it to standard output. (I had this working, but am now running into issues with Unity.exe hanging when run from Jenkins. Though this is happening with or without my file monitor.)

5 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by kork · Feb 09, 2016 at 07:35 PM

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: https://effectiveunity.com/articles/how-to-create-your-own-unity-cloud-build-part-3.html (it's actually about TeamCity but the same principles apply for Jenkins as well).

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Flassari · Oct 25, 2016 at 11:51 AM 1
Share

YES! Thank you, that works perfectly.

avatar image roddles · Mar 15, 2018 at 07:42 PM 0
Share

Cool. This also works for applications built with Unity3D. Worked on my server app (Linux headless mode). Using Ubuntu 14.04 and Unity 5.6: ./myapp.x86_x4 -logfile

avatar image Salocin808 · May 25, 2018 at 12:19 PM 0
Share

cannot access the article :(

avatar image
2

Answer by QualityJohn_TT · Feb 22, 2021 at 05:13 PM

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

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mickee · Sep 04, 2021 at 09:34 AM 0
Share

Thanks a lot, works perfectly on 2019.3.9f1 also.

avatar image Bojko · Nov 27, 2021 at 09:44 PM 0
Share

As of Nov 2021 this is still the only answer that works with Unity 2020.3+

avatar image
0

Answer by thehemi · Feb 23, 2018 at 10:33 PM

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

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Flassari · Feb 27, 2018 at 08:14 AM 0
Share

Which Unity version?

avatar image thehemi Flassari · Feb 27, 2018 at 04:56 PM 0
Share

5.6.3p3 - Windows

avatar image KBaxtrom-LevelEx · Mar 19, 2018 at 02:43 PM 0
Share

Looks like this will work as stated on OSX, but not on windows. Currently on Unity 2017.3. The lack of documentation on the unsupplied file path feels like a bug or just happenstance rather than actual functionality.

avatar image
0

Answer by jrodenburg_ncsoft · Jun 28, 2018 at 10:47 PM

Reproduced this issue with -logfile and no parameters on 2017.4.6. Seems fixed in 2018.1 https://issuetracker.unity3d.com/issues/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

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Deepscorn · Aug 18, 2018 at 06:38 PM 0
Share

https://issuetracker.unity3d.com/issues/command-line-logfile-with-no-parameters-outputs-to-screen-on-os-x-but-not-on-windows Seems not fixed. By the way, one more idea (not tested, should work in theory) for workaround: Unity uses Debug.Log() when outputting logs, including logs during build. Set Application.log$$anonymous$$essageReceived and redirect logs where you want

avatar image
0

Answer by watsonsong · Oct 11, 2018 at 12:05 PM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

D3D12: using slow scratch memory!? Anyone knows what it is?? 0 Answers

Debug.Log() in build 9 Answers

Meta information for builds installed using Unity Cloud Build 0 Answers

How to get multiple output log files for a game build? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges