Can Build and Runtime Logs be Correlated in MATLAB Deployment Diagnostics?
0 reputation · 15 Jul 2024, 07:44 UTC
Goal
When a MATLAB application fails after deployment, the build log produced by compiler.build and the runtime log emitted by the MATLAB Runtime (MCR) are often the only sources of information. The goal is to establish a reliable correlation between these two log streams so that a single failure can be traced back to its build‑time context.
Constraints and Uncertainty
Current build logs lack correlation identifiers that persist into runtime. The MCR writes a one‑line version banner to stderr but does not emit a JSON event that can be parsed by log aggregation tools. In Docker deployments, the entrypoint script redirects stdout and stderr but discards environment information such as LD_LIBRARY_PATH or license host IDs, leaving environment‑dependent failures invisible.
Specific Questions
1) Does MATLAB provide a mechanism to embed a unique deployment identifier in both the build log and the runtime logs?
2) Can the MCR be configured to emit a machine‑parseable version event without requiring a reinstall with a different -loglevel?
3) Is there a supported way to preserve environment variables in Docker worker logs for license‑checkout or path‑resolution failures?