8

For a project I need to analyze my browser web log file data. But I don't know where it resides and how to get data from it? Can anyone help me?

3 Answers 3

13

Project Chromium answers your question very well. However I will condense the information to only what you want.

Browser Web logs : Where they reside ?

Debug logs are stored in the user data directory as chrome_debug.log and this file is overwritten every time Chrome restarts. However you can stop the file from being overwritten by moving it to the desktop. So, Default User Data Directory for various platforms are :

1. On Windows

The default location is in the local app data folder :

[Chrome] %LOCALAPPDATA%\Google\Chrome\User Data
[Chromium] %LOCALAPPDATA%\Chromium\User Data

2. On MacOSX

In the Application Support folder :

[Chrome] ~/Library/Application Support/Google/Chrome
[Chromium] ~/Library/Application Support/Chromium

3. On Linux

In the ~/.config folder :

[Chrome Stable] ~/.config/google-chrome
[Chrome Beta] ~/.config/google-chrome-beta
[Chrome Dev] ~/.config/google-chrome-unstable
[Chromium] ~/.config/chromium

For More Platforms, Visit this.


For your Project, If you need you can Override the User Data Directory by typing this at command line

[Windows] chrome.exe --user-data-dir=c:\foo
[Linux]   google-chrome --user-data-dir=/path/to/foo
[Windows] chromium-browser --user-data-dir=c:\foo
[Linux]   chromium-browser --user-data-dir=/path/to/foo

Browser Web logs : How to enable and get data from it ?

By default, browser debug logs aren’t generated, so you’ll need to enable logging using command-line flags.

--enable-logging --v=1

Before using chrome_debug.log in a project, be aware that it can contain some personal information, such as URLs opened during that session of chrome.

Since the debug log is a human-readable text file, you can open it up with a text editor (notepad, vim, etc..) and use it just like the test file.

Also, the boilerplate values enclosed by brackets on each line are in the format :

[ process_id : thread_id : ticks_in_microseconds : log_level : file_name(line_number) ]

That would help in some way or other in your project.

2
  • Did logs move on macOS @C0deDaedalus directories=.metadata_never_index Default/ MEIPreload/ Safe Browsing Cookies Subresource Filter/ Address Validation Rules External Extensions/ NativeMessagingHosts/ Safe Browsing Cookies-journal TLSDeprecationConfig/ BrowserMetrics-spare.pma FileTypePolicies/ OriginTrials/ SafetyTips/ Webstore Downloads/ CertificateRevocation/ First Run PepperFlash/ .....(way more) May 5, 2020 at 17:24
  • Looks like logs have moved on Mac but I'm not sure where.
    – tschumann
    Jul 22, 2020 at 2:07
0

From Chrome for enterprise Help Debug logs are stored in the user data directory as chrome_debug.log.

By default, browser debug logs aren’t generated, so you’ll need to enable logging

0

If you closed ALL chrome processes (sometimes extensions still run even Chrome is closed, you need to close them too as I believe)

If you enabled logging:

--enable-logging

(--log-level=0 - doesn't dump lots of system info in a log)

and still can't find log file - look in environment variables. There it is: CHROME_LOG_FILE

1
  • Nothing seems to get logged unless --v=1 is passed as well.
    – tschumann
    Jul 22, 2020 at 2:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.