Giter VIP home page Giter VIP logo

jquery.clientsidelogging's People

Contributors

remybach avatar robmiller avatar sweh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jquery.clientsidelogging's Issues

parse error from index.php and view_logs.php

Hello
I'm working with the test.php to confirm my settings. I've set the permissions on log.txt and access.txt to 777.

Unfortunately I'm getting a parse error from the php logging script. (index.php)

The client side Javascript is successfully posting to index.php. But it returns the error below.
post:
https://nginx/js_app/log/index.php?type=error&format=text&msg=fdasdfa

response:
Parse error: syntax error, unexpected T_FUNCTION in /appl/apache/tti/js_app/log/index.php on line 71

** The view_logs.php is also printing this error in the iframe.

Parse error: syntax error, unexpected T_FUNCTION in /appl/apache/tti/js_app/log/view_logs.php on line 40

Appends unwanted client info to JS object.

For those of us who are using javascript frameworks to send and receive json objects to the backend, having the clientside information appended to our JS objects is unacceptable.

EDIT: To be clear, this is when console.loging a JS object that will eventually be sent to the backend.

The offending code is on lines 129 & 130:

        // Let's grab the additional logging info before we send this off.
        $.extend(what, _buildClientInfo());

This would be better changed to:

        // Let's grab the additional logging info before we send this off.
        var result = {};
        $.extend(result, what, _buildClientInfo());;

then send result along with the data:

        _data[defaults.query_var] = JSON.stringify(result);

Thanks for the plugin. Continue the great work!

Choosing the default settings

Currently, the default settings are pretty conservative; they basically disable everything and rely on the user to enable what they want.

Is this the best choice? It may well be, I just wanted to provoke some discussion.

Personally, I think the default settings should reflect sensible defaults that most people are going to want to use — so that most people can just run the main function and leave the rest.

For me, the sensible defaults are:

  • error_url, info_url, and log_url set to the sample backend — e.g. /log.php?type=error.
  • log_level set to 1 — I think people care initially about just errors, and will increase that level as and when they need to
  • native_error set to true — are there any downsides to this?
  • query_var set to msg — people will only need to change this if they're using a custom backend.
  • hijack_console to true — this respects log_level, and I think programmer-triggered errors should be treated the same as window.onerror.
  • All client_info set to true — can't think of a reason why, in normal usage, you wouldn't want to log as much info as possible to help diagnose problems.

Any input?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.