0

I'd like to be able to log my console to a file rather than just to the browser console. I'm having page refresh issues and would like to be able to see what is causing them. Can anyone tell me how to write any console.log(...) commands to an external file? Is there a way to set this up globally, and how do you set it back?

kickinchicken
  • 1,281
  • 4
  • 18
  • 40
  • You need a serverless function or any kind of backend server to write down to a file/DB. – kissu Nov 15 '22 at 12:38
  • 1
    Does this answer your question? [Is it possible to write data to file using only JavaScript?](https://stackoverflow.com/questions/21012580/is-it-possible-to-write-data-to-file-using-only-javascript) – David Nov 15 '22 at 12:40
  • Even if I just want to do this locally while developing? – kickinchicken Nov 15 '22 at 12:40
  • 1
    If you want to do that only locally, you can always send some logging info to a running local server. VueJS by itself doesn't write to the filesystem as far as I know. – kissu Nov 15 '22 at 12:42
  • I ended up using Chrome's "Preserve Log" under the Developer Tools settings. This helps. @David - I didn't try that, but it's something I might consider. Thanks!!! – kickinchicken Nov 15 '22 at 12:43
  • Your SPA should not "refresh" a page tho, you might have quite some issues if it's the case. – kissu Nov 15 '22 at 12:48

1 Answers1

0

I ended up using Chrome's "Preserve Log" under the Developer Tools settings. This helps. @David - I didn't try that, but it's something I might consider. Thanks!!!

kickinchicken
  • 1,281
  • 4
  • 18
  • 40