playerone
playerone

Reputation: 1127

Javascript logging to file on local computer

I need to create log from web application in Chrome(angularjs/javascript) on client/local machine. Any idea how to do that?

I couldn't use activeX object in Chrome.

Upvotes: 1

Views: 845

Answers (2)

areve
areve

Reputation: 524

You can't log to local machine, some suggestions

  • Window.localStorage - the amount of data you can log is very small, most browsers support this but size limits vary.
  • Chrome also supports WebSQL (I don't know if it will drop this in the future) space is limited to 5MB, other browser support is different.
  • Install other software to do the logging. (Using any for of ajax request to talk to a server listening on http(s)://localhost:port. e.g. You could use socket.io to make a logger in node.js)
  • Log to the server. (Using any for of ajax request.)

Upvotes: 1

Johannes Jander
Johannes Jander

Reputation: 5020

You can't directly do this. You could use StackTrace.js to push the stacktrace to the server and then read it back in your web application or make it available as a download.

Upvotes: 2

Related Questions