简体   繁体   中英

Client side logging using node.js(maybe without modules)

Is it clever to put a try,catch around my minified java script code and whenever someone gets an error on the client side it will send a POST to my server and writes(appends) it into a file on the server file system ?

The problem here I see is security one, everybody could POST anything to my server and cause a BufferOverflow or fill it so that nobody else could write to that log file anymore or he could write malicouse code in it !?

What do you think?

Client Errors to server side logging is a good idea if you want to be able to fix client side errors.

Otherwise, you'd be leaning on your own testing to catch all these errors (which you certainly won't). There's a nice blog post with code and video example showing how to implement this. http://www.bennadel.com/blog/2542-logging-client-side-errors-with-angularjs-and-stacktrace-js.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM