Debug logs are stored in the user data directory as chrome_debug. log. The file is overwritten every time Chrome restarts. So, if you have an issue with the browser, check the log before you restart Chrome.
Chrome dev tools now allows you to save the console output to a file natively
Chrome Developer instructions here.
I needed to do the same thing and this is the solution I found:
Enable logging from the command line using the flags:
--enable-logging --v=1
This logs everything Chrome does internally, but it also logs all the console.log()
messages as well. The log file is called chrome_debug.log
and is located in the User Data Directory
which can be overridden by supplying --user-data-dir=PATH
(more info here).
CONSOLE(\d+)
.Note that console logs do not appear with --incognito
.
I have found a great and easy way for this.
In the console - right click on the console logged object
Click on 'Store as global variable'
See the name of the new variable - e.g. it is variableName1
Type in the console: JSON.stringify(variableName1)
Copy the variable string content: e.g. {"a":1,"b":2,"c":3}
There is an open-source javascript plugin that does just that, but for any browser - debugout.js
Debugout.js records and save console.logs so your application can access them. Full disclosure, I wrote it. It formats different types appropriately, can handle nested objects and arrays, and can optionally put a timestamp next to each log. You can also toggle live-logging in one place, and without having to remove all your logging statements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With