Filter Chrome DevTools Console Logs by Level and Text
In the Chrome DevTools Console, the Log level menu on the toolbar can show only errors and warnings. If you type text in the Filter box, only logs containing that text remain. Typing url: shows only logs from a specific script, and -url: hides logs from scripts such as ads or external libraries. This is useful for debugging when many logs bury your own console.log output. I built a test page that prints nine logs and checked how many remain under each condition. The results are below.
The test environment was Ubuntu 24.04 with Chrome for Testing 158.0.8127.36 (the version bundled with Playwright 1.63.0). I launched Chrome with a window on a virtual display and operated the DevTools docked below the window by sending mouse and keyboard input. I set DevTools to English, so buttons and items are written with their English labels. I did not test Chrome on macOS or Windows, logs from iframes or Workers, the Selected context only setting in Console settings, or the search bar opened with Ctrl+F.
- 1. Test page
- 2. Show only errors and warnings with the Log level menu
- 3. Typing in the Filter box keeps only logs containing that text
- 4. Search with a regular expression by wrapping the text in /
- 5. Use url: to see only logs from a specific script
- 6. Show only logs from the page's JavaScript with the sidebar
- 7. Hide only network messages such as 404s
Test page
The page (http://localhost:8080/) loads app.js from the same server and ads.js from a different host, http://127.0.0.1:8081/ads.js. The contents of app.js are below. The last fetch requests a URL that does not exist and receives a 404.
console.debug('[cart] 在庫を確認します');
console.log('[cart] カートに追加しました: item=1');
console.info('[user] ログインしました');
console.warn('[cart] 在庫が残りわずかです');
console.log('[Cart] 合計: 1200円');
console.error('[api] 注文に失敗しました: status=500');
fetch('/api/missing');
ads.js prints two logs in place of a real ad script.
console.log('[ads] 広告を読み込みました');
console.warn('[ads] 古い API を使っています');
When I loaded the page with DevTools open, the Console showed the following eight logs, and "1 hidden" appeared on the right side of the toolbar. The app.js:2 and similar labels at the start of each line are the links shown at the right end of each message in the actual UI. They give the file that logged the message and its line number.
app.js:2 [cart] カートに追加しました: item=1
app.js:3 [user] ログインしました
app.js:4 [cart] 在庫が残りわずかです(警告)
app.js:5 [Cart] 合計: 1200円
app.js:6 [api] 注文に失敗しました: status=500(エラー)
ads.js:1 [ads] 広告を読み込みました
ads.js:2 [ads] 古い API を使っています(警告)
:8080/api/missing:1 Failed to load resource: the server responded with a status of 404 (Not Found)(エラー)
The last line is a message from the browser itself, not from the page's JavaScript. The one hidden log was the console.debug message "Checking stock". The reason is explained in the next section.
Show only errors and warnings with the Log level menu
Logs from console.* have four levels: Verbose, Info, Warning, and Error. According to the Console API reference, console.debug is Verbose, console.log and console.info are Info, console.warn is Warning, and console.error is Error.
Press the button labeled "Default levels" on the toolbar, and a menu for choosing levels opens. At first, Info, Warnings, and Errors were checked, and Verbose was not. That is why the console.debug logs were not visible at the start.

Each time you press a menu item, its check toggles, and the Console updates immediately. These are the results in order.
| Action | Button label | Messages shown | Toolbar (right side) |
|---|---|---|---|
| Do nothing | Default levels | 8 | 1 hidden |
| Press Verbose | All levels | 9 | (not shown) |
| Then press Info | Custom levels | 5 | 4 hidden |
| Then press Warnings | Custom levels | 3 | 6 hidden |
| Press Default | Default levels | 8 | 1 hidden |
With only Verbose and Errors checked, three messages remained: "Checking stock" and the two errors (status=500 and the 404). To see only errors, uncheck Verbose, Info, and Warnings. To return to the initial state, press Default at the top of the menu.
Typing in the Filter box keeps only logs containing that text
When you type text in the Filter box on the toolbar, only logs containing that text are shown. These are the results.
| Filter text | Logs remaining |
|---|---|
cart |
3 logs: the 2 [cart] logs and the [Cart] 合計 log |
CART |
The same 3 logs |
status=500 |
1 log: [api] 注文に失敗しました: status=500 |
ads.js |
The 2 [ads] logs |
127.0.0.1 |
0 logs |
Case is ignored, so both cart and CART leave [Cart] 合計. With ads.js, the two [ads] logs remained even though ads.js does not appear in the message text. The file name is shown at the right end as ads.js:1, and the filter matches it. In contrast, typing 127.0.0.1, the host that serves ads.js, left nothing. To filter by host name or file URL, use url:, which is described later.
Typing two words separated by a space keeps only logs that contain both. cart 在庫 leaves only the one [cart] log about low stock.
Putting - in front of a word removes logs that contain it. -ads removes the two [ads] logs and leaves 6. -ads -Failed also removes the 404 message and leaves 5.
The Filter box and the Log level menu both apply. If you type cart and then choose Verbose in the Log level menu, the [cart] "Checking stock" log is added, giving 4 logs.
Search with a regular expression by wrapping the text in /
If you wrap the text in the Filter box in /, it is treated as a regular expression. The Console reference section on regular expression filtering says the pattern is matched against both the message text and the script that logged the message.
| Filter text | Logs remaining |
|---|---|
/\[(cart|api)\]/ |
4 logs: the 2 [cart] logs, the [Cart] 合計 log, and the [api] error |
/^\[cart\]/ |
3 logs: the 2 [cart] logs and the [Cart] 合計 log |
/\[CART\]/ |
The same 3 logs |
/status=\d{3}/ |
1 log: the status=500 error |
/ads\.js/ |
The 2 [ads] logs |
To find logs containing any one of several strings, such as [cart] or [api], use |. Regular expressions also ignore case, so /\[CART\]/ matched both [cart] and [Cart]. With ^, /^\[cart\]/ left only the 3 logs whose message starts with [cart] or [Cart].
The official documentation says that spaces cannot be used in a regular expression, so you should use \s instead. In my test, /古い\sAPI/ and /古い API/ both left the one [ads] log that says it uses an old API. /古い XAPI/ left 0 logs. To search for logs containing a space, use \s as the documentation says, to be safe.
Use url: to see only logs from a specific script
As described in the Console reference section on filtering by URL, typing url: in the Filter box shows candidate URLs of the scripts that logged messages. In my test, three candidates appeared. The first candidate's remaining text was filled in faintly in the box, and the screenshot shows the list narrowed to the 2 [ads] logs under that condition.

The 404 URL (/api/missing) in the candidates is the URL of the browser's message. After url:, you can type only part of a URL and still get a match. Putting - in front, as in -url:, hides logs from that script.
| Filter text | Logs remaining |
|---|---|
url:http://127.0.0.1:8081/ads.js |
The 2 [ads] logs |
url:127.0.0.1 |
The 2 [ads] logs |
url:app.js |
The 5 logs from app.js |
-url:http://127.0.0.1:8081/ads.js |
6 logs, excluding the 2 [ads] logs |
-url:127.0.0.1 |
The same 6 logs |
url:http://localhost:8080/app.js cart |
The 3 [cart] and [Cart] logs from app.js |
As in the last row, you can combine url: with text separated by a space, and only logs matching both remain. To hide logs from ads or external libraries, put that script's host name after -url:. Browser messages such as the 404 error still remain.
Show only logs from the page's JavaScript with the sidebar
Pressing the "Show Console sidebar" button at the far left of the toolbar opens a sidebar on the left side of the Console. In my test, six items were listed: 9 messages, 8 user messages, 2 errors, 2 warnings, 4 info, and 1 verbose. Even with Verbose hidden by the Default levels setting, the sidebar showed 9 messages and 1 verbose. So the counts include hidden logs.
As described in the Console reference section on hiding browser messages, pressing "user messages" shows only logs from the page's JavaScript. In my test, the browser's 404 message disappeared, and 8 messages were shown, including the Verbose "Checking stock" log. When you expand "user messages," the files that logged appear below it, such as app.js 6 and ads.js 2. Pressing ads.js leaves only the 2 [ads] logs.

Pressing "2 errors" shows only the 2 errors. Pressing "2 warnings" shows only the 2 warnings, and pressing "1 verbose" shows only the "Checking stock" log. While a sidebar item is selected, the Log level button shows a grey "Custom levels" label. Pressing "messages" at the top shows all 9 logs, including Verbose. The Filter box also works with the sidebar. With "2 errors" selected, typing api leaves two logs: the [api] error and the 404 message, whose URL contains api.
Hide only network messages such as 404s
Pressing the gear icon (Console settings) at the right end of the Console toolbar shows a list of checkboxes. The official section on hiding network messages says to check "Hide network." In Chrome for Testing 158, which I used for this test, there is no item with that name. Instead, there is an item called "Network messages" at the top left, and it was checked from the start.
Unchecking it removed only the 404 "Failed to load resource" message and left the 7 logs from app.js and ads.js. The toolbar's right side showed "2 hidden." The two hidden logs are the Verbose log and the 404 message. Use this setting when you want to read only script logs in the Console. Check failed requests in the Network panel.





