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
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 Data2. On MacOSX
In the Application Support folder :
[Chrome] ~/Library/Application Support/Google/Chrome
[Chromium] ~/Library/Application Support/Chromium3. 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/chromiumFor 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/fooBrowser 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=1Before 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.
2From Chrome for enterprise HelpDebug 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
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