Как посмотреть логи в хроме
Перейти к содержимому

Как посмотреть логи в хроме

  • автор:

Where to find Google Chrome logs

Where to find the Google Chrome logs? In which location can I find the Chrome logs if it crashes?

Jonathan Leffler's user avatar

4 Answers 4

First, you must enable crash logging in advanced settings by ticking «Automatically send usage statistics and crash reports to Google».
Crash logs can then be found in chrome://crashes .
Note that by enabling this, your crash reports and stats will be sent to Google servers.

Dump files are stored under %HOMEPATH%\AppData\Local\Google\Chrome\User Data\Crashpad\reports

Mac OS 10.13.4 Chrome Version 73.0.3683.103 (Official Build) (64-bit)

In some cases, if you cannot access the Chrome settings page, create a shortcut for chrome and add the following flag to the target.

Then run Chrome using that shortcut, and you can see the log file in your user folder.

enter image description here

    The Overflow Blog
Linked
Related
Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.3.11.43304

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Как посмотреть логи в хроме

Открытие средств разработчика Edge Chromium

  1. Откройте выпадающее меню и выберите Сеть.

Переход в сеть в меню Edge Chromium

  1. Нажмите Значок очистить в левом верхнем углу, чтобы очистить сетевой журнал.

Как посмотреть логи в хроме

Log messages in the Console

Published on Friday, April 19, 2019

Kayce Basques

Technically, I’m a writer

This interactive tutorial shows you how to log and filter messages in the Chrome DevTools Console.

Messages in the Console.

This tutorial is intended to be completed in order. It assumes that you understand the fundamentals of web development, such as how to use JavaScript to add interactivity to a page.

# Set up the demo and DevTools

This tutorial is designed so that you can open up the demo and try all the workflows yourself. When you physically follow along, you’re more likely to remember the workflows later.

Optional: Move the demo to a separate window. In this example, the tutorial is on the left, and the demo is on the right.

Focus the demo and then press Control + Shift + J or Command + Option + J (Mac) to open DevTools. By default DevTools opens to the right of the demo.

DevTools docked to the bottom of the demo.

DevTools docked to the bottom of the demo:

DevTools undocked in a separate window.

DevTools undocked in a separate window:

# View messages logged from JavaScript

Most messages that you see in the Console come from the web developers who wrote the page’s JavaScript. The goal of this section is to introduce you to the different message types that you’re likely to see in the Console, and explain how you can log each message type yourself from your own JavaScript.

Click the Log Info button in the demo. Hello, Console! gets logged to the Console.

Next to the Hello, Console! message in the Console, click log.js:2. The Sources panel opens and highlights the line of code that caused the message to get logged to the Console.

DevTools opens the Sources panel after you click log.js:2.

The message was logged when the page’s JavaScript called console.log(‘Hello, Console!’) .

Navigate back to the Console using any of the following workflows:

  • Click the Console tab.
  • Press Control + [ or Command + [ (Mac) until the Console is in focus. , start typing Console , select the Show Console Panel command, and then press Enter .

Click the Log Warning button in the demo. Abandon Hope All Ye Who Enter gets logged to the Console.

The Console after clicking Log Warning.

Messages formatted like this are warnings.

Optional: Click log.js:12 to view the code that caused the message to get formatted like this, and then navigate back to Console when you’re finished. Do this whenever you want to see the code that caused a message to get logged a certain way.

Click the Expand icon in front of Abandon Hope All Ye Who Enter . DevTools shows the stack trace leading up to the call.

A stack trace.

The stack trace is telling you that a function named logWarning was called, which in turn called a function named quoteDante . In other words, the call that happened first is at the bottom of the stack trace. You can log stack traces at any time by calling console.trace() .

Click Log Error. The following error message gets logged: I’m sorry, Dave. I’m afraid I can’t do that.

Click Log Table. A table about famous artists gets logged to the Console.

A table in the Console.

Note how the birthday column is only populated for one row. Check the code to figure out why that is.

Click Log Group. The names of 4 famous, crime-fighting turtles are grouped under the Adolescent Irradiated Espionage Tortoises label.

Click Log Custom. A message with a red border and blue background gets logged to the Console.

The main idea here is that when you want to log messages to the Console from your JavaScript, you use one of the console methods. Each method formats messages differently.

There are even more methods than what has been demonstrated in this section. At the end of the tutorial you’ll learn how to explore the rest of the methods.

# View messages logged by the browser

The browser logs messages to the Console, too. This usually happens when there’s a problem with the page.

Click Cause 404. The browser logs a 404 network error because the page’s JavaScript tried to fetch a file that doesn’t exist.

Click Cause Error. The browser logs an uncaught TypeError because the JavaScript is trying to update a DOM node that doesn’t exist.

Click the Log Levels drop-down and enable the Verbose option if it’s disabled. You’ll learn more about filtering in the next section. You need to do this to make sure that the next message you log is visible. Note: If the Default Levels drop-down is disabled, you may need to close the Console Sidebar. Filter by Message Source below for more information about the Console Sidebar.

Click Cause Violation. The page becomes unresponsive for a few seconds and then the browser logs the message [Violation] ‘click’ handler took 3000ms to the Console. The exact duration may vary.

# Filter messages

On some pages you’ll see the Console get flooded with messages. DevTools provides many different ways to filter out messages that aren’t relevant to the task at hand.

The Console filters out only the output messages, all inputs that you typed into the Console stay there.

# Filter by log level

Each console.* method is assigned a severity level: Verbose , Info , Warning , or Error . For example, console.log() is an Info -level message, whereas console.error() is an Error -level message.

Note: For a full list of console.* methods and their severity levels, see the Console API reference.

To filter by log level:

Click the Log Levels drop-down and disable Errors. A level is disabled when there is no longer a checkmark next to it. The Error -level messages disappear.

Click the Log Levels drop-down again and re-enable Errors. The Error -level messages reappear.

The Console always remembers the drop-down filter you apply. It persists across all pages as well as page, DevTools, and Chrome reloads. To quickly apply a temporary filter, use the Sidebar.

# Filter by text

When you want to only view messages that include an exact string, type that string into the Filter text box.

Type Dave into the Filter text box. All messages that do not include the string Dave are hidden. You might also see the Adolescent Irradiated Espionage Tortoises label. That’s a bug.

Delete Dave from the Filter text box. All the messages reappear.

# Filter by regular expression

When you want to show all messages that include a pattern of text, rather than a specific string, use a regular expression.

Type /^[AH]/ into the Filter text box. Type this pattern into RegExr for an explanation of what it’s doing.

Delete /^[AH]/ from the Filter text box. All messages are visible again.

# Filter by message source

When you want to only view the messages that came from a certain URL, use the Sidebar.

Sidebar filters are temporary. The Console doesn’t persist such filters across all pages as well as page, DevTools, and Chrome reloads.

Show Console Sidebar.

Click Show Console Sidebar .

Click the Expand icon next to 12 Messages. The Sidebar shows a list of URLs that caused messages to be logged. For example, log.js caused 11 messages.

# Filter by user messages

Earlier, when you clicked Log Info, a script called console.log(‘Hello, Console!’) in order to log the message to the Console. Messages logged from JavaScript like this are called user messages. In contrast, when you clicked Cause 404, the browser logged an Error -level message stating that the requested resource could not be found. Messages like that are considered browser messages. You can use the Sidebar to filter out browser messages and only show user messages.

Click 9 User Messages. The browser messages are hidden.

Click 12 Messages to show all messages again.

# Use the Console alongside any other panel

What if you’re editing styles, but you need to quickly check the Console log for something? Use the Drawer.

Click the Elements tab.

Press Escape . The Console tab of the Drawer opens. It has all of the features of the Console that you’ve been using throughout this tutorial.

# Next steps

Congratulations, you have completed the tutorial. Click Dispense Trophy to receive your trophy.

Логи консоли браузера

В этом курсе мы научимся собирать логи консоли браузера. Десктопные браузеры работают одинаково во всех настольных операционных системах, поэтому вы можете выполнять те же действия в Windows, MacOS или Linux.

Google Chrome / И любой браузер на базе Chromium.

1. Нажмите CTRL+Shift+I или выберите значок три точки > Дополнительные инструменты > Инструменты разработчика
2. Выберите Консоль > значок шестерни в правом верхнем углу.
3. Прокрутите вниз, чтобы найти Параметры консоли > выберите Показать метки времени и Сохранить лог при навигации.
4. Выход из настроек
5. Очистите консоль, нажав на значок "Очистить консоль" или щелкнув правой кнопкой мыши в окне консоли и выбрав "Очистить консоль".
6. Обновить страницу и воспроизвести баг , начиная с домашней страницы
7. Щелкните правой кнопкой мыши по логам и выберите "Сохранить как".
Кроме того, вы можете скопировать лог-файлы с консоли и вставить их в любую программу текстового редактора.
8. Сохранить файл как .txt
9. Откройте лог консоли и убедитесь, что на сайте тестирования есть метки времени и строка 'Navigated to' (например, 18:32:30.854 Navigated to https://www.utest.com ).

Примечание: Следуйте тем же шагам для сбора логов консоли для любого браузера на базе Chromium,таких как новый браузер Microsoft Edge, Opera, Brave, Yandex.

Firefox

1. Выберите иконку меню в правом верхнем углу и выберите Web Developer > Web Console.
2. На консоли выберите значок передачи в правом верхнем углу и выберите Persist Logs и Show Timestamps.
3. Нажмите на значок корзины, чтобы очистить ваши старые логи.
4. Обновить страницу и воспроизвести баг, начиная с домашней страницы
5. Чтобы сохранить логи, щелкните правой кнопкой мыши на консоль > выберите "Экспорт видимых сообщений" > "Файл".
6. Сохранить файл как .txt
7. Откройте лог консоли и убедитесь, что на сайте тестирования есть метки времени и строка 'Navigated to' (например, 18:32:30.854 Navigated to https://www.utest.com ).

Примечание: Если вы не видите никаких временных меток внутри консоли, попробуйте изменить размер рамки консоли до тех пор, пока не появятся временные метки.

Internet Explorer

1. Выберите значок шестерни в правом верхнем углу > выберите F12 Инструменты для разработчиков
2. В консоли отключите режим "Очистить при навигации" и нажмите красный X, чтобы удалить старые логи.
3. Обновите домашнюю страницу и воспроизведите баг, начиная с домашней страницы.
4. Чтобы сохранить логи, щелкните правой кнопкой мыши в консоли и выберите пункт "Копировать все".
5. Вставьте скопированные журналы в новый документ Блокнота.
6. Сохранить файл как .txt

Примечание: Журналы, генерируемые Internet Explorer, не содержат временных меток.

Safari

1. Нажмите на Safari в строке меню и выберите Параметры.
2. Выберите значок "Расширенное управление" > выберите "Показывать меню разработки" в строке меню.
3. Закрыть и выбрать раскрывающееся меню "Разработка" > "Показать веб-инспектор".
4. В консольном окне выберите "Сохранить лог" и щелкните по значку "Корзина", чтобы очистить лог.
5. Обновите домашнюю страницу и воспроизведите баг, начиная с домашней страницы.
6. Чтобы сохранить журналы, нажмите Command+S
7. Сохранить файл как .txt

Примечание: Журналы, генерируемые Safari, не содержат временных меток.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *