Console features reference
This article is an outline of the features of the Console.
- Open the Console
- View messages
- Filter messages
- Clear the Console
Open the Console
Open the Console tool
J (Windows, Linux) or
To open the Console tool from the Command Menu, type
Console and then run the Show Console command that has the Panel badge next to it.
Open the Console tool in the Drawer
Esc. Or, click Customize and control DevTools (
...) and then select Show console drawer.
The Drawer pops up in the bottom of the DevTools window, with the Console tool open.
To open the Console tool from the Command Menu, type Console and then run the Show Console command that has the Drawer badge next to it.
Open Console Settings
Click the Console Settings () button.
Open the Console Sidebar
To display the Sidebar, click Show console sidebar (). The Sidebar helps you filter.
This section contains features that change how messages are presented in the Console. For a hands-on walkthrough, see View messages.
Turn off message grouping
To turn off the default message grouping behavior of the Console, click the Console Settings () button and then select the checkbox next to Group similar. For an example, see Log XHR and Fetch requests.
Log XHR and Fetch requests
To log all
Fetch requests to the Console as each happens, click the Console Settings () button and then select the checkbox next to Log XMLHttpRequests.
The top message in previous figure displays the default grouping behavior of the Console.
Persist messages across page loads
When you load a new webpage, the default action clears the Console. To persist messages across page loads, click the Console Settings () button and then select the checkbox next to Preserve Log.
Hide network messages
The default action for Microsoft Edge is to logs network messages to the Console. In the following figure, the selected message represents an HTTP status code of
To hide network messages:
Click the Console Settings () button.
Select the checkbox next to Hide Network.
There are multiple ways to filter out messages in the Console.
Filter out browser messages
Filter by log level
DevTools assigns each
console.* method one of the four severity levels:
console.log() is in the
Info group, but
console.error() is in the
Error group. The Console object API Reference describes the severity level of each applicable method. Every message that the browser logs to the Console has a severity level too.
You can hide any level of messages that you're not interested in. For example, if you're only interested in
Error messages, you can hide the other three groups.
To filter the messages, click the Log Levels dropdown list and then select
To use the log level to filter, open the Console Sidebar and then select Errors, Warnings, Info, or Verbose.
Filter messages by URL
url: followed by a URL to only view messages that came from that URL. After you type
url:, DevTools displays all relevant URLs. Domains also work. For example, if
https://example.com/b.js are logging messages,
url:https://example.com allows you to focus on the messages from these two scripts.
To hide messages from a URL, type
-url:. It's a negative URL filter.
To display messages from a single URL:
Expand the # user messages section.
Select the URL of the script that contains the messages that you want to focus on.
Filter out messages from different contexts
Suppose that you have an advertisement (ad) on your webpage. The ad is embedded in an
Filter out messages that don't match a regular expression pattern
Type a regular expression such as
/[gm][ta][mi]/ in the Filter text box to filter out any messages that don't match that pattern. DevTools checks whether the pattern is found in the message text or in the script that caused the message to be logged.
Rerun expressions from history
Enter to run that expression again.
Watch the value of an expression in real time with Live Expressions
Turn off Eager Evaluation
- Click the Console Settings () button.
- Clear the checkbox next to Eager Evaluation.
Turn off autocomplete from history
As you type out an expression, the autocomplete popup window for the Console displays expressions that you ran earlier. The expressions are pre-pended with the
> character. To stop displaying expressions from your history, click the Console Settings () button and then clear the checkbox next to Autocomplete From History checkbox.
In the following figure,
document.querySelector('img') are expressions that were evaluated earlier.
Suppose you have an ad on your webpage embedded in an
Clear the Console
To clear the Console, use any of the following approaches:
Click Clear Console ().
Right-click a message and then select Clear Console.
clear()in the Console and then press
Lwhile the Console is in focus.
- Log messages in the Console tool - How to filter log messages such as Info, Warnings, and Errors in the Console.
- Console object API Reference - Functions and expressions that you can enter in the Console to write messages to the Console, such as
- Console tool utility functions and selectors - Convenience functions that you can enter in the Console tool, such as
Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons Attribution 4.0 International License. The original page is found here and is authored by Kayce Basques (Technical Writer, Chrome DevTools & Lighthouse).
This work is licensed under a Creative Commons Attribution 4.0 International License.
Submit and view feedback for