11

Does any one know how/whether it is possible to preserve the console output, errors, info etc of Safari's Web Inspector?

I'm trying to debug an ajax call thats failing and navigating to the page but I can't see the error as it clears as soon as it navigates, any ideas?

Cheers

justcompile
  • 3,362
  • 1
  • 29
  • 37

4 Answers4

13

In Safari 9 (Mac OS X El Capitan), you can right click anywhere in the console and select "Keep Log on Navigation".

Jimothy
  • 9,150
  • 5
  • 30
  • 33
  • 1
    How about on the network tab? any idea please? right click doesnt work on safari 10 Network tab – A user Apr 10 '17 at 10:53
  • Has this been removed from Safari 11? When I right click in the console tab, the only options I get are `Copy Selected`, `Save Selected` and `Clear Log` – Klas Mellbourn Sep 25 '17 at 16:02
4

In Safari 11, you should click the cogwheel in the Web Inspector

Cogwheel in Web Inspector

and uncheck Console: Clear when page navigates:

Console: Clear when page navigates

Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
1

It seems there is no browser based log persistence in Safari currently. You can however use

debugger;

at any point in your code to cause execution to stop and the developer tools will open. If you log any values to console before the debugger; statement you will be able to see those values still in the console.

0

Hitting command + . in the middle of the process to stop the browser can help if you're trying to see network calls before they clear. I've had mixed luck with it though.