Logging is enabled only in Debug and Development builds. To enable logging in Test and Shipping builds set “bUseLoggingInShipping=true” in your *.Target.cs file.
This is from Advanced Debugging in Unreal Engine | Tutorial. And implies that its a pretty simple process. However, in practice it seems that you’ll get an error that tells you first you need to have another value set in order to enable this when using an Installed Build (which I am). So the question is - what is the proper way then to enable this when using an installed build when it seems to be prohibited from within your project?
I thought perhaps just set the flag to be true anywhere it is false in the source Target.cs parent class inside my build but doing that just created a whole bunch of new build issues. Anyway, looking to see if anyone else has done this so I can just do it right the first time instead of just guessing. No documentation I can see that identifies the right way.
But if you use : BuildEnvironment = TargetBuildEnvironment.Unique; inside an Installed build, you will have this error when packaging your game : UATHelper: Packaging (Windows): Targets with a unique build environment cannot be built with an installed engine.
So, for an installed build, you need to only set :
bUseLoggingInShipping = true;
Also, logs are NOT generated in your project’s saved folder in SHIPPING ! They are inside the : C:/Users/my.username/AppData/Local/MyProject folder
This last point took me days to figure it out why I had no logs at all in my project’s Saved folder
I’m also working with an installed build. I did 3 changes, but I’m not sure they are all necessary.
With all those changes (3 Source modifications + Project.target.cs changes) , I’m able to have logs in an Installed build in Shipping game.
Maybe some of them are over kill, but it takes more than 5 hours to test without one of them. So I keep them.
Also, we can modify the log file name and destination if you start your app with a command line : C:\Deployment\Package\Windows\Binaries\Win64\MyProject-Win64-Shipping.exe ABSLOG="C:\MyCustomLogFolderPath\MyCustomLogFile.log"
If you run your app with this param, your log is where you need it to be.
This function in code source allow us to do it :