Skip to main content

Crash reporting

API BackendTooling

Report important environmental information when an error occurs or a process crashes.


yarn add @boost/debug


Sometimes an application or script fails. Sometimes we want to write an error log with environmental information about the failure. Boost supports this exact scenario.

Take advantage of crash reporting by importing and instantiating the CrashReporter class.

import { CrashReporter } from '@boost/debug';

const reporter = new CrashReporter();

The reporter supports a collection of chainable methods that log targeted information, grouped into sections. View the API for more information on these methods.


If you'd like to add your own section and label value pairs, use CrashReporter#addSection(), which requires a title, and CrashReporter#add(), which accepts a label and one or many values.

.add('Location', user.address,;

Once all the information has been buffered, we can write the content to a log file by using CrashReporter#write(), which requires an absolute file path.

reporter.write(path.join(process.cwd(), 'error.log'));