---
title: "JavaScript SDK: Console logs"
description: "Capture console logs for bug reports with the Gleap JavaScript SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/406-javascript-sdk-console-logs
collection: "JavaScript"
updated: 2026-11-01
language: en
---

# JavaScript SDK: Console logs

Capture console logs for bug reports with the Gleap JavaScript SDK. Follow the integration code examples.

The Gleap JavaScript SDK collects console logs by default and attaches the last 500 entries to every ticket:

-   `console.log`, `console.info`, `console.debug`, `console.warn` and `console.error` calls, including failed `console.assert` checks. Objects, arrays and errors are logged as readable JSON and stack traces instead of `[object Object]`.
    
-   Uncaught errors (`Uncaught TypeError: …` with the stack) and unhandled promise rejections, which never pass through the console methods.
    
-   Clicks on the page (the clicked element), as click entries.
    

Your console output stays exactly as it was: Gleap calls the original console methods and never changes the `console` object itself. Error entries are cut at 5000 characters, other entries at 1000, and marked `… [truncated]`.

> **Note:** Uncaught errors, unhandled rejections, `console.debug` and the object formatting need SDK **v19.0.0** or newer.

Further more you can make use of our [custom logs](#custom-logs), which offer more control over the logs.

## Disable default console logs

It is possible to disable the default collection of console logs by calling the following method prior to the initialization of Gleap.

```javascript
Gleap.disableConsoleLogOverwrite();
```

## Custom logs

Custom logs allow you to create logs in the Gleap activity log. There are three severity types available for logs: `ERROR`, `WARNING` and `INFO`.

```javascript
Gleap.log("This is a test custom log.");
```

By default logs will be created with the severity `INFO`. Use the following method to explicitly set the severity.

```javascript
Gleap.log("This is a test custom log WARNING.", "WARNING");
```

## Related

- [JavaScript SDK setup](https://docs.gleap.ai/en/articles/393-javascript-sdk-setup.md)
- [JavaScript SDK: Code snippet](https://docs.gleap.ai/en/articles/394-javascript-sdk-code-snippet.md)
- [JavaScript SDK: User identity](https://docs.gleap.ai/en/articles/395-javascript-sdk-user-identity.md)
- [JavaScript SDK: Callbacks](https://docs.gleap.ai/en/articles/396-javascript-sdk-callbacks.md)
- [JavaScript SDK: AI chatbar](https://docs.gleap.ai/en/articles/397-javascript-sdk-ai-chatbar.md)
