optional
By default, LogRocket logs the following methods of the console API:
console.logconsole.infoconsole.debugconsole.warnconsole.error
LogRocket's console capture can be modified with the options below.
isEnabled
optional - boolean
Disable this boolean to prevent logging of console data to LogRocket.
LogRocket.init(YOUR_APP_ID, {
console: {
isEnabled: false,
},
});isEnabled.[log|info|debug|warn|error]
optional - boolean
You can also disable specific console methods by setting the method name to be false. By default, all methods will be logged unless explicitly set to false.
// This will log all console.info, console.warn, and console.error calls.
LogRocket.init(YOUR_APP_ID, {
console: {
isEnabled: {
log: false,
debug: false,
},
},
});shouldAggregateConsoleErrors
optional - boolean
Use this option to control whether aggregated data about messages logged with console.error() or LogRocket.error() is surfaced in LogRocket error reporting.
LogRocket.init(YOUR_APP_ID, {
console: {
shouldAggregateConsoleErrors: true,
},
});