Chrome лог ошибок

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

Jonathan Leffler's user avatar

asked Oct 5, 2012 at 6:07

MindBrain's user avatar

5

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…

answered Apr 2, 2014 at 14:17

1

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

I got:

~/Library/Application Support/Google/Chrome/Crashpad/completed/

answered Apr 21, 2019 at 4:00

Jake G's user avatar

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

--enable-logging --v=1

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

C:\Users\[User name]\AppData\Local\Google\Chrome\User Data\chrome_debug.log

Chrome Browser debug logs

enter image description here

answered Jan 2 at 7:03

Thusitha Jayasundara's user avatar

Журналы отладки браузера Chrome помогают при устранении неполадок, например при зависании вкладок. Журналы не создаются автоматически, поэтому сначала нужно включить ведение журналов.

Как включить ведение журналов

Примечание. В инструкциях подразумевается, что браузер Chrome установлен в папку по умолчанию.

Windows

  1. Выйдите из браузера Chrome.
  2. Нажмите правой кнопкой на ярлык Chrome.
  3. Выберите Свойства.
  4. В конце строки Target: добавьте следующие параметры командной строки: --enable-logging --v=1
    В результате строка должна выглядеть вот так: chrome.exe --enable-logging --v=1
  5. Нажмите Применить > OK.
  6. Запустите Chrome, дважды нажав на ярлык.

macOS

  1. Выйдите из браузера Chrome.
  2. Откройте приложение «Терминал».
  3. Выполните следующую команду:
    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-logging --v=1
  4. Нажмите Ввод.

Linux

  1. Выйдите из браузера Chrome.
  2. Откройте эмулятор приложения «Терминал».
  3. Запустите Chrome со следующим параметром:
    --enable-logging --v=1
  4. Нажмите Ввод.

Журналы отладки хранятся в каталоге пользовательских данных под именем chrome_debug.log. Файл перезаписывается при каждом запуске Chrome, поэтому при возникновении ошибки проверяйте его до перезапуска браузера. Вы можете сохранить его копию, например на рабочем столе, чтобы данные не потерялись при перезаписи.

Расположение каталога зависит от операционной системы. Подробнее…

Как читать журналы

Существуют инструменты, которые помогают при чтении журналов и поиске источника проблемы, например Sawbuck для Microsoft® Windows® или «Консоль» для Apple® Mac® (Программы > Утилиты > Консоль). Они представляют журналы в графическом интерфейсе и позволяют использовать фильтры и поиск.

Также файлы журналов можно открыть в текстовом редакторе и использовать информацию ниже для поиска проблем.

На что обратить внимание

Начните с поиска ключевого слова ERROR в файле chrome_debug.log. Однако это не всегда является основной причиной неполадок. Например, если пользователь жалуется на то, что приложение слишком медленно запускается, вы можете увидеть повторяющиеся строчки в начале файла журнала или большие значения идентификаторов процессов (PID) и потоков (TID).

Строки файла журнала идут в хронологическом порядке и имеют следующий формат:

[PROCESS_ID:THREAD_ID:MMDD/TIME:LOGGING_LEVEL:SOURCE_CODE_FILE_NAME(LINE_NUMBER)]

Пример: [7352:11760:0809/012714:VERBOSE1:resource_loader.cc(630)]

  • PROCESS_ID. Идентификатор текущего процесса.

  • THREAD_ID. Идентификатор потока внутри идентификатора процесса.

  • MMDD. Текущий месяц и день. В примере выше это 9 августа.

  • TIME. Текущее время в 24-часовом формате ЧЧ:ММ:СС. Это поможет сузить диапазон поиска до времени, когда проблема проявилась.

  • LOGGING_LEVEL. Уровень важности текущего сообщения в журнале. Обычно это значение равно VERBOSE1. Также могут встречаться вхождения со значением ERROR.

  • SOURCE_CODE_FILE_NAME(LINE_NUMBER). Имя и строка файла с исходным кодом, выполнение которого привело к появлению записи в журнале.

Эта информация оказалась полезной?

Как можно улучшить эту статью?

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

Jonathan Leffler's user avatar

asked Oct 5, 2012 at 6:07

MindBrain's user avatar

5

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…

answered Apr 2, 2014 at 14:17

1

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

I got:

~/Library/Application Support/Google/Chrome/Crashpad/completed/

answered Apr 21, 2019 at 4:00

Jake G's user avatar

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

--enable-logging --v=1

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

C:\Users\[User name]\AppData\Local\Google\Chrome\User Data\chrome_debug.log

Chrome Browser debug logs

enter image description here

answered Jan 2 at 7:03

Thusitha Jayasundara's user avatar

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.

  1. Open the demo.

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

    This tutorial on the left, and the demo on the right.

  3. 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 opens to the right of the demo.

  4. Optional: Dock DevTools to the bottom of the window or undock it into a separate window.

    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.

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

    The Console after clicking Log Info.

  2. 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!').

  3. 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.
    • Open the Command Menu, start typing Console, select the Show Console Panel command, and then press Enter.
  4. 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.

  5. 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.

  6. Click the Expand 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().

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

    An error message.

  8. 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.

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

    A group of messages in the Console.

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

    A message with custom formatting in 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.

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

    A 404 error in the Console.

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

    A TypeError in the Console.

  3. 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.

    Enabling the Verbose log level.

  4. 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.

    A violation in the Console.

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:

  1. 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.

    Disabling Error-level messages in the Console.

  2. 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.

  1. 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.

    Filtering out any message that does not include `Dave`.

  2. 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.

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

    Filtering out any message that does not match the pattern `/^[AH]/`.

  2. 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.

  1. Click Show Console Sidebar Show Console Sidebar..

    The Sidebar.

  2. Click the Expand 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.

    Viewing the source of messages in the Sidebar.

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.

  1. Click 9 User Messages. The browser messages are hidden.

    Filtering out browser messages.

  2. 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.

  1. Click the Elements tab.

  2. 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.

    The **Console** tab in the Drawer.

Next steps

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

  • See Console Reference to explore more features and workflows related to the Console UI.
  • See Console API Reference to learn more about all of the console methods that were demonstrated in View messages logged from JavaScript and explore the other console methods that weren’t covered in this tutorial.
  • See Get Started to explore what else you can do with DevTools.
  • See Format and style messages in the Console to learn more about all of the console format and styling methods.

При использовании веб-приложений и сайтов в Интернете мы иногда сталкиваемся с ошибками, которые могут привести к проблемам пользования этими ресурсами. Чтобы понять, что именно вызывает ошибку, полезно знать, как посмотреть лог ошибок браузера. В этой статье мы рассмотрим способы просмотра логов ошибок в популярных браузерах.

Лог ошибок браузера — это файл, в котором хранятся сообщения об ошибках и предупреждениях, связанных с работой браузера и его расширений. Эти сообщения могут включать информацию о невозможности загрузки ресурсов, сбоях в работе JavaScript, проблемах с SSL-сертификатами и других проблемах.

В каждом браузере есть свой способ посмотреть лог ошибок браузера, который мы рассмотрим далее.

Google Chrome

Для просмотра лога ошибок браузера в Google Chrome нужно выполнить следующие шаги:

1. Откройте браузер Google Chrome и нажмите на иконку «Меню» (три вертикальные точки), расположенную в правом верхнем углу экрана.

2. Наведите курсор мыши на пункт меню «Инструменты» и выберите «Разработчик».

3. В выпадающем меню выберите «Инструменты разработчика», или можно вызвать данное окно, нажав сочетание клавиш Ctrl+Shift+I (Windows) или Command+Option+I (Mac).

4. В открывшемся окне нажмите на вкладку «Console».

5. Лог ошибок браузера будет отображен в этой вкладке.

Mozilla Firefox

Чтобы посмотреть лог ошибок браузера в Mozilla Firefox, следуйте инструкциям:

1. Откройте браузер Mozilla Firefox и нажмите на иконку «Меню» (три горизонтальные линии), расположенную в правом верхнем углу экрана.

2. Наведите курсор мыши на пункт меню «Web-разработка» и выберите «Консоль разработчика».

3. Для вызова консоли разработчика можно также использовать сочетание клавиш Ctrl+Shift+K (Windows) или Command+Option+K (Mac).

4. В открывшемся окне нажмите на вкладку «Консоль».

5. Лог ошибок браузера будет отображен в этой вкладке.

Microsoft Edge

Если вы используете браузер Microsoft Edge, то для просмотра лога ошибок браузера нужно выполнить следующие действия:

1. Откройте браузер Microsoft Edge и нажмите на иконку «Меню и настройки» (три горизонтальные точки), расположенную в верхнем правом углу экрана.

2. Наведите курсор мыши на пункт меню «Система» и выберите «Отладка Microsoft Edge».

3. В открывшемся окне нажмите на вкладку «Консоль».

4. Лог ошибок браузера будет отображен в этой вкладке.

Apple Safari

Для просмотра лога ошибок браузера в Apple Safari нужно выполнить следующие шаги:

1. Откройте браузер Apple Safari и выберите пункт меню «Разработка» в меню строчки заголовка.

2. Если пункт меню «Разработка» не отображается, то необходимо его открыть. Для этого щелкните мышью на пункте меню «Сафари», выберите «Настройки» и включите режим «Разработчика» вкладкой «Дополнительно».

3. В выпадающем меню выберите «Открыть консоль».

4. В открывшемся окне можно увидеть лог ошибок браузера.

Opera

Чтобы посмотреть лог ошибок браузера в Opera, выполните следующие инструкции:

1. Откройте браузер Opera и выберите пункт меню «Настройки» в правом верхнем углу экрана.

2. Наведите курсор мыши на пункт меню «Разработка» и выберите «Консоль».

3. Для вызова консоли разработчика можно также использовать сочетание клавиш Ctrl+Shift+I (Windows) или Command+Option+I (Mac).

4. Лог ошибок браузера будет отображен в этой вкладке.

Итак, мы рассмотрели способы просмотра логов ошибок в Google Chrome, Mozilla Firefox, Microsoft Edge, Apple Safari и Opera. Эта информация может быть полезна для тех, кто занимается web-разработкой, но также полезна для пользователей, которые хотят понимать причины возникающих проблем при использовании веб-ресурсов в Интернете.

Понравилась статья? Поделить с друзьями:

Интересное по теме:

  • Chivalry 2 ошибка входа
  • Chrome код ошибки 1 0x80004005 system level
  • Chkdsk проверка связей имен файлов возникла неопределенная ошибка
  • Cf4b ошибка bmw
  • Chrome игнорировать ошибки сертификатов

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии