Main Content

Manage Log Files

MATLAB® Production Server™ generates several log files when it starts. You can set server configuration properties to specify where and when to store and archive logs, as well as the level of details to log.

Best Practices for Log Management

  • Avoid placing log files and archived log files on different physical file systems.

  • Place log files on local drives, not on network drives.

  • Send MATLAB output to stdout. Develop an appropriate, consistent logging strategy following MATLAB coding best practices.

Log Retention and Archive Settings

The main_config server configuration file of a server instance contains properties that you can set to manage log files. The main.log file contains logs of server and worker processes for as long as a specific server instance is active, or until midnight.

  • Specify the location of main.log by setting the log-root property in main_config.

  • When you restart the server, log data is written to an archive log. Specify the location of the archive log folder by setting the log-archive-root property in main_config.

You can specify when a server instance archives main.log by setting the following properties in main_config:

  • log-rotation-size — When main.log reaches this size, the active log is written to an archive log (located in the folder specified by log-archive-root).

  • log-archive-max-size — When the combined size of all files in the archive folder (location defined by log-archive-root) reaches this limit, archive logs are purged until the combined size of all files in the archive folder is less than log-archive-max-size. Oldest archive logs are deleted first.

Specify values for these properties using the following units and notations:

Unit of MeasurementNotationExample
Byte b900b
Kilobyte (1024 bytes)k700k
Megabytes (1024 kilobytes)m40m
Gigabytes (1024 megabytes)g10g
Terabytes (1024 gigabytes)t2t
Petabytes (1024 terabytes)p1p


The minimum value you can specify for log-rotation-size is 1 megabyte.

On Windows® 32-bit systems, values larger than 232 bytes are not supported. For example, specifying 5g is not valid on Windows 32-bit systems.

Log Detail Levels

Log levels provide different levels of information for troubleshooting. Set log levels using the log-severity server configuration property. log-severity supports the following values:

  • error — Notification of problems or unexpected results

  • warning — Events that might lead to problems if unaddressed

  • information — High-level information about major server events

  • trace — Detailed information about the internal state of the server

Before you call technical support, set the log level to trace.

See Also

| | | |