MATLAB Answers

Creating a runtime log for deployed application

63 views (last 30 days)
Alexander Tye
Alexander Tye on 26 Feb 2018
Commented: Deependra Mishra on 11 Feb 2019
I am using Application Compiler to create standalone versions of scripts. To debug, I would like to create a runtime log, but MATLAB does not appear to do so when I tick the box. Has anyone else had this problem?


Sign in to comment.

Answers (1)

Chandani Madnani
Chandani Madnani on 1 Mar 2018
Edited: Chandani Madnani on 1 Mar 2018
Log file is created in the same folder when you execute exe from for_testing or for_redistribution_files folders.
If you are running from for_redistribution, the log files will not be created if the application launched does not have privileges to write files in the installation directory. For example, in operating systems like Windows 7, the application running with user privileges will not be allowed to create files under "C:\Program Files". If the deployed application is installed under the "C:\Program Files" or "C:\Program Files (x86)" path, please follow the workarounds mentioned below to generate log files from the application.
1. The application can be launched as administrator. For Windows 7 - Right click on the application executable or shortcut and click on "Run as administrator"
2. Install the application in a path where the user running the application has privileges to create files. For example, installing under the Path: "C:\Users\<user_name>"


Deependra Mishra
Deependra Mishra on 11 Feb 2019
Workaround 1: Running app as an administrator didn't work.
Workaround 2: Installing the app under user folder worked. Log file is generated in the same folder as exe file.
Deependra Mishra
Deependra Mishra on 11 Feb 2019
Eventhough I was administrator I had a special permission setting which does not have write permission to the program files folder. Changing the user privileges to write in the installation folder, log file was generated. Workaround 1 also works.
Deependra Mishra
Deependra Mishra on 11 Feb 2019
Had one issue with this.
When I tried to install the app using web installer and selected the add shortcut to desktop. Everytime I start the application it creates a log file in desktop which will clutter the desktop with many log file if I open multiple times. I am generating custom log file based on date and time. It seems like the shortcut is not really a shortcut.
When I delete and create another shortcut then in that case log file is not created in the desktop, instead it is created at C:\Program Files\MyAppMainFolder\MyApp\application where the actual app .exe file resides.
Do you know how we can suppress the creation of log file in desktop when we select Add shortcut icon to desktop during app installation??

Sign in to comment.

Sign in to answer this question.