> ## Documentation Index
> Fetch the complete documentation index at: https://docs.germainux.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript Console and Error Monitoring

> GermainUX automatically captures JavaScript errors and browser-console events generated while users interact with monitored web applications.

Components
[`JS Profiler`](https://docs.germainux.com/main/germain-ux-js-profiler)
[`RUM JS`](https://docs.germainux.com/main/germain-ux-rum-js)
[`RUM Extension`](https://docs.germainux.com/main/germain-ux-rum-extension)

Availability
2022.1 or later

Browser support
only latest Chrome, Edge and Opera

> **[Monitoring components](#monitoring-components)**
>
> Required collectors and extensions

> **[Continuous monitoring](#continuous-monitoring)**
>
> Capture errors during real sessions

> **[Advanced filtering and processing](#advanced-filtering-and-processing)**
>
> Filter events in code

> **[Deployment and configuration](#deployment-and-configuration)**
>
> Console capture setup

## Overview

GermainUX automatically captures JavaScript errors and browser-console events generated while users interact with monitored web applications. Each event is associated with its application, page, browser, user, and session context, helping teams understand what failed, who was affected, and what the user experienced.

> [!NOTE]
>
> JavaScript Console and Error Monitoring is enabled by default for each User Monitoring Profile.

## Monitoring components

| Component | Role |
| - | - |
| [GermainUX RUM JS](https://docs.germainux.com/main/germain-ux-rum-js.md) | Continuously captures JavaScript errors and selected console events when the monitoring script can be deployed in the application. |
| [GermainUX RUM Extension](https://docs.germainux.com/main/germain-ux-rum-extension.md) | Provides browser monitoring when RUM JS cannot be deployed directly or access to the complete browser-page context requires an extension. |
| [GermainUX JS Profiler](https://docs.germainux.com/main/germain-ux-js-profiler.md) | Captures deeper JavaScript execution, function timing, stack traces, browser activity, DOM activity, and network evidence for code-level investigation. |

## Capabilities

GermainUX can capture and analyze:

* Uncaught JavaScript errors reported by the browser.
* Console errors generated by the monitored application.
* Error messages and available stack traces.
* The application, page, browser, user, and session associated with each error.
* Additional console methods when explicitly enabled.
* User interactions and browser activity occurring around the error.

> **Show all 9**
>
> * Error frequency, recurrence, trends, and affected-user counts.
> * Related network requests, long tasks, freezes, and other available technical evidence.
> * Detailed JavaScript execution information when the JS Profiler is enabled.

JavaScript errors handled internally by the application are available to GermainUX only when the application reports them through a monitored mechanism, such as the browser console.

## Default monitoring

By default, GermainUX collects:

| Event | Default behavior |
| - | - |
| Browser JavaScript errors | Collected |
| `console.error()` events | Collected |
| Other console methods | Not collected unless explicitly selected |

![JavaScript Console Error on RCA](https://mintcdn.com/germain-ux/S6CZjLTFu68xyZFG/images/main/javascript-console-and-error-monitoring/image-20230323-151003.png?fit=max\&auto=format\&n=S6CZjLTFu68xyZFG\&q=85\&s=d28edf9481d80f9e2c3e5ee373a4f217)

No configuration is required for the default behavior.

## Continuous monitoring

GermainUX RUM JS or the GermainUX RUM Extension continuously captures JavaScript errors and configured console events during real user sessions.

Use:

* **RUM JS** when the GermainUX monitoring script can be deployed directly in the application.
* **RUM Extension** when direct script deployment is unavailable or the application’s security architecture prevents access to the required browser context.

The collected events are associated with the relevant user and session, enabling support and development teams to investigate the error in the context in which it occurred.

![JavaScript Console Events on Analysis Portlet](https://mintcdn.com/germain-ux/S6CZjLTFu68xyZFG/images/main/javascript-console-and-error-monitoring/image-20230323-114603.png?fit=max\&auto=format\&n=S6CZjLTFu68xyZFG\&q=85\&s=ee0ae39f795921e6d8798ab5ba375078)

S

## Code-level investigation with JS Profiler

When continuous monitoring identifies an error that requires deeper technical evidence, the GermainUX JS Profiler can help investigate:

* JavaScript function execution.
* Function duration.
* Exclusive and cumulative execution time.
* Long-running browser tasks.
* JavaScript errors and stack traces.
* Browser events and user interactions.

> **Show all 9**
>
> * DOM and rendering activity.
> * Network requests and resource loading.
> * Application, page, and session context.

The JS Profiler complements RUM JS and the RUM Extension. Continuous monitoring can remain enabled across the user population, while deeper profiling should normally be limited to the applications, pages, users, sessions, or periods required for an investigation.

## Business benefits

JavaScript Console and Error Monitoring helps organizations:

* Detect front-end failures affecting real users.
* Identify the users, sessions, pages, and workflows affected by each error.
* Prioritize errors according to frequency and actual user or business impact.
* Understand what users did before and after an error.
* Reduce the time spent reproducing intermittent problems.
* Distinguish isolated errors from widespread application failures.

> **Show all 9**
>
> * Detect regressions introduced by new application releases.
> * Provide developers with actionable messages, stack traces, session evidence, and code-level diagnostics.
> * Validate that a correction eliminated or reduced the error.

## Analytics

GermainUX can analyze JavaScript errors and console events through KPIs, measures, pivots, trends, drill-through views, and session context.

| Analysis area | Examples |
| - | - |
| Error | Message, error type, stack trace, or console method |
| Impact | Affected users, sessions, pages, and workflows |
| Frequency | Occurrence count, recurrence, concentration, and trend |
| Environment | Application, release, browser, operating system, and device |
| User context | Clicks, navigation, page activity, and Session Replay |
| Technical context | Network requests, long tasks, browser freezes, and related errors |
| Code-level evidence | JavaScript functions, execution time, DOM activity, and resources |

![JavaScript Console and Error Monitoring: Analytics](https://mintcdn.com/germain-ux/S6CZjLTFu68xyZFG/images/main/javascript-console-and-error-monitoring/image-20260903-210001.png?fit=max\&auto=format\&n=S6CZjLTFu68xyZFG\&q=85\&s=e57daf30ab7e8fc705bd61afc561a309)

SGermainUX users can create watches to receive notifications when collected error insights meet conditions of interest.

## Configuration

Configuration is required only when the default console-event collection needs to be customized.

### Collect additional console methods

The following example collects informational messages, warnings, and errors:

```javascript theme={null}
const settings = germainApm.getDefaultSettings();

settings.plugins.console.methods = [
  "info",
  "warn",
  "error"
];

germainApm.start(settings);
```

Supported console methods include:

* `assert`
* `clear`
* `count`
* `countReset`
* `debug`
* `dir`

> **Show all 20**
>
> * `dirxml`
> * `error`
> * `group`
> * `groupCollapsed`
> * `groupEnd`
> * `info`
> * `log`
> * `table`
> * `time`
> * `timeEnd`
> * `timeLog`
> * `timeStamp`
> * `trace`
> * `warn`

Collect only the console methods required for the monitoring use case. Verbose methods such as `log` or `debug` can generate a substantial amount of data.

### Disable console-event collection

To disable console-event collection, configure an empty `methods` array:

```javascript theme={null}
const settings = germainApm.getDefaultSettings();

settings.plugins.console.methods = [];

germainApm.start(settings);
```

This setting disables the configured console methods. Browser-error collection may be managed separately by the applicable monitoring profile.

### Limit collected content

Console messages and stack traces can contain large amounts of text. Use `maxLogStringLength` to limit the amount of console content collected.

The following example collects informational messages, warnings, and errors while limiting each console value to 100 characters:

```javascript theme={null}
const settings = germainApm.getDefaultSettings();

settings.plugins.console = {
  methods: ["info", "warn", "error"],
  maxLogStringLength: 100
};

germainApm.start(settings);
```

The default maximum console-content length is 1,024 characters.

Select a limit that preserves useful diagnostic information while controlling data volume and reducing the risk of collecting unnecessary content.

## Advanced filtering and processing

Use `eventProcessor` when application-specific logic is required to filter or modify a console event before GermainUX sends it.

```typescript theme={null}
eventProcessor?: (
  event: LogMonitoringEvent,
  fireEvent: (event: MonitoringEvent) => void,
  settings: MonitoringSettings
) => boolean;
```

The processor must return:

* `true` to send the processed event.
* `false` to discard the event.

Use advanced processing to:

* Exclude known non-actionable messages.
* Remove or replace sensitive values.
* Normalize dynamic error messages.
* Categorize application-specific errors.
* Reduce duplicate or excessively verbose events.

## Privacy and data protection

Console messages, error text, stack traces, URLs, and related application context can contain sensitive information.

Before collecting additional console methods:

* Review what the application writes to the browser console.
* Avoid logging passwords, authentication tokens, payment data, personal information, or other secrets.
* Limit console collection to the methods required.
* Truncate unnecessarily long values.
* Filter or sanitize sensitive content with `eventProcessor`.
* Restrict access to detailed error and session information.
* Apply the organization’s retention and compliance requirements.

## Recommended investigation workflow

1. Use RUM JS or the RUM Extension to detect JavaScript errors affecting real users.
2. Determine the affected users, sessions, pages, browsers, and workflows.
3. Review the error message, stack trace, and related session evidence.
4. Correlate the error with clicks, navigation, network requests, long tasks, freezes, and other available events.
5. Enable the JS Profiler for a controlled scope when deeper code-level evidence is required.
6. Identify the responsible function, script, resource, or dependency.
7. Implement the correction.
8. Validate the result using continuous error monitoring and, when necessary, another targeted profiling session.

## Deployment and configuration

* Review [Browser Monitoring](https://docs.germainux.com/main/browser-monitoring.md).
* Review the [Browser Monitoring Deployment Overview](https://docs.germainux.com/main/deployment-for-browser-monitoring.md).
* Deploy [GermainUX RUM JS](https://docs.germainux.com/main/germain-ux-rum-js.md) when the monitoring script can be added to the application.
* Deploy the [GermainUX RUM Extension](https://docs.germainux.com/main/germain-ux-rum-extension.md) when direct script deployment is unavailable or access to the complete browser-page context requires an extension.
* Deploy the [GermainUX JS Profiler](https://docs.germainux.com/main/germain-ux-js-profiler.md) for deeper JavaScript execution and code-level diagnostics.
* Review the available [Browser Monitoring configuration](https://docs.germainux.com/main/configuration-for-browser-monitoring.md).

> **Show all 11**
>
> * Review [Unhandled Promise Rejection Monitoring](https://docs.germainux.com/main/unhandled-promise-rejection-monitoring.md).
> * Review [Dead, Error and Rage Click Monitoring](https://docs.germainux.com/main/dead-error-and-rage-click-monitoring.md).
> * Review [JavaScript Long Task and Browser Freeze Detection](https://docs.germainux.com/main/javascript-long-task-monitoring.md).
> * Review the [KPIs for User Monitoring and Replay](https://docs.germainux.com/main/user-monitoring-and-replay-kpis.md).
> * Review the available Browser Monitoring KPIs.

## Get Help

> **[Contact GermainUX Support](https://docs.germainux.com/main/support.md)**
>
> The Germain Team can help you set this up.

> **Can't find what you need?**
>
> Search all GermainUX docs with **Ctrl + K**, or use the feedback buttons at the bottom of this page to tell us what is missing.

The content of this document is proprietary to GERMAIN SOFTWARE.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.