How do I log the CTF component and MATLAB function name being called in the log file of MATLAB Production Server (MPS)?

4 views (last 30 days)
I'm trying to log some metrics regarding MPS usage like the CTF component and the function name that is being called. I've set the logging levels on the instances in the MPS dashboard to multiple different levels, but none seem to get me exactly what I'm looking for.
Even after changing the "--log-severity" property to "trace", the "main_log" file does not list the calls to the MATLAB functions and corresponding CTF.
How do I log the CTF component and MATLAB function name being called in the log file of MPS?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Sep 2023
The "--profile" property can be used to log the CTF and MATLAB function names in the "main_log" file.
There are two ways to turn on "--profile": 
  • Update "--profile" property in the MPS instance "main_config" file, which will require a re-start.
  • Use "mps-profile" command on the running instance, this does not require a re-start. They have the same syntax and using "mps-profile" command will override the "--profile" property in config file.
Use the below syntax when updating the main_config file or using "mps-profile" command:
--profile on server.request.archive
An example log after setting the "--profile" property:
203 [2023.07.24 10:12:44.439549] [profile] [component:mpsTestData] [connection_id:1] [function:myMagic] [service:http-connection] Request arrived and was placed in the queue.
Note: "component:mpsTestData" is the name of the CTF, "function:myMagic" is the name of the MATLAB function.
For more detailed information on "--profile" property, please refer to this link:
There are few points to be aware of where the property may get reset after the MPS instance is restarted:
  • If you are using "mps-profile" command to update the configuration, the properties will get reset (with or without dashboard) after the instance is restarted.
  • If you are using MPS:
    • Without dashboard: updating the configuration using "main_config" file will persist the properties after the instance is restarted.
    • With dashboard: A workaround that previous customers have found success with is setting the profile configuration using the GUI itself so that the properties will not be overwritten after each restart.
Please set the profile configuration using the GUI itself so that the properties will not be overwritten after each restart.
Add "--profile on server.request.archive" to this path: Settings > Advanced > Additional Options.
Please see the below image which shows an example of how to input the information into the GUI:

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!