Additional runtime configuration of report generation is available via the following properties of process.report:

    reportOnFatalError triggers diagnostic reporting on fatal errors when true. Defaults to false.

    reportOnSignal triggers diagnostic reporting on signal when true. This is not supported on Windows. Defaults to false.

    reportOnUncaughtException triggers diagnostic reporting on uncaught exception when true. Defaults to false.

    signal specifies the POSIX signal identifier that will be used to intercept external triggers for report generation. Defaults to 'SIGUSR2'.

    filename specifies the name of the output file in the file system. Special meaning is attached to stdout and stderr. Usage of these will result in report being written to the associated standard streams. In cases where standard streams are used, the value in directory is ignored. URLs are not supported. Defaults to a composite filename that contains timestamp, PID and sequence number.

    directory specifies the filesystem directory where the report will be written. URLs are not supported. Defaults to the current working directory of the Node.js process.

    1. // Trigger report only on uncaught exceptions.
    2. process.report.reportOnFatalError = false;
    3. process.report.reportOnSignal = false;
    4. process.report.reportOnUncaughtException = true;
    5. // Trigger report for both internal errors as well as external signal.
    6. process.report.reportOnFatalError = true;
    7. process.report.reportOnSignal = true;
    8. process.report.reportOnUncaughtException = false;
    9. // Change the default signal to 'SIGQUIT' and enable it.
    10. process.report.reportOnFatalError = false;
    11. process.report.reportOnUncaughtException = false;
    12. process.report.reportOnSignal = true;
    13. process.report.signal = 'SIGQUIT';

    Configuration on module initialization is also available via environment variables:

    1. NODE_OPTIONS="--report-uncaught-exception \
    2. --report-on-fatalerror --report-on-signal \
    3. --report-signal=SIGUSR2 --report-filename=./report.json \
    4. --report-directory=/home/nodeuser"

    Specific API documentation can be found under [process API documentation][] section.