You can enable trace for a running node application, or you can enable trace before an application has been started.
 


About this task

  • To enable trace before an application has been started, you can set the following environment variables:
  • On Windows: set MQLIGHT_NODE_LOG=debug
  • On Linux and Mac OS: export MQLIGHT_NODE_LOG=debug
  • To enable trace for a running node application, you must first find the process ID for the application, and complete the following the steps.

 


Procedure

  • Open a command prompt in the node_module/mqlight folder of the client install.
    For example:
    cd node_modules/mqlight
  • Run the mqlight-debug application, supplying the process ID and a trace level.
    For example:
    node bin/mqlight-debug.js -p --level=debug

 


What to do next


The examples provided start with a logging level of ‘debug’. The following levels of trace are also available:

  • entry_exit – log function entry and exit (with return codes).
  • parms – as entry_exit, but with function parameters logged as well.
  • data – as entry_exit, but with additional data logging.
  • debug – as entry_exit, but with additional debug entries.
  • detail – as entry_exit, but with higher detail data logging.
  • all – log everything (this can quickly output a high volume of data).

 
By default, log output goes to the STDERR directory. This can be changed to STDOUT by setting the environment variable MQLIGHT_NODE_LOG_STREAM stdout
The output can also be sent to a file, by setting MQLIGHT_NODE_LOG_STREAM.

Join The Discussion

Your email address will not be published.