{"id":20659312,"url":"https://github.com/iphands/js-client-logger","last_synced_at":"2026-04-21T14:35:54.930Z","repository":{"id":15705499,"uuid":"18443439","full_name":"iphands/js-client-logger","owner":"iphands","description":"A simple framework to send JS client side errors to a remote server for persistence","archived":false,"fork":false,"pushed_at":"2014-04-07T18:58:51.000Z","size":184,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-30T23:51:52.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iphands.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-04T15:31:50.000Z","updated_at":"2014-04-07T18:58:52.000Z","dependencies_parsed_at":"2022-09-01T05:11:57.957Z","dependency_job_id":null,"html_url":"https://github.com/iphands/js-client-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iphands/js-client-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Fjs-client-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Fjs-client-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Fjs-client-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Fjs-client-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iphands","download_url":"https://codeload.github.com/iphands/js-client-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iphands%2Fjs-client-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32096161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T18:33:54.627Z","updated_at":"2026-04-21T14:35:54.909Z","avatar_url":"https://github.com/iphands.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"js-client-logger\n================\n\nA script that logs client side JavaScript messages to a server for persistence.\u003cbr/\u003e\nBy default window.onerror and JQuery ajaxErrors are intercepted, logged and then left to do their own thing.\u003cbr/\u003e\nThis lets you see what errors clients run into without teaching them about various JavaScript consoles.\n\n##Simple Usage\n```\njs_client_logger.init({\n    logger_url: \"/services/logger/log\"\n});\n```\n\n##A logger that blacklists a User Agent\n```\njs_client_logger.init({\n    logger_url: \"/services/logger/log\",\n    skip_function: function () {\n        // example of how to skip certain user agents\n        // anything that returns true will be skipped\n        if (navigator.userAgent.indexOf('spider') !== -1) {\n            return true;\n        }\n    }\n});\n```\n\n##What the payload to the server looks like\n```\n{\n  \"message\": {\n    \"error_message\": \"Uncaught TypeError: Cannot read property 'bar' of undefined\",\n    \"script_url\": \"https://localhost/js-client-logger/example.html\",\n    \"line_number\": 26,\n    \"user_agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36\"\n  },\n  \"path\": \"https://localhost/js-client-logger/example.html\",\n  \"page_log_count\": 1\n}\n```\n\n##Example server code\n\nProvided is a stupid simple server that writes the POST data from the JavaScript logger to disk.\u003cbr/\u003e\nI would not use this in production, but it should give you an idea of how to build a logging service into your existing web application.\n\nTo run the example:\n```\n$ gem install webrick\n$ ruby example_server/server.rb\n```\n\nThen hit \u003ca href=\"http://localhost:55555/\"\u003ehttp://localhost:55555\u003c/a\u003e with your browser.\u003cbr/\u003e\nLog files will be written to /tmp/js-client-logger.output by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiphands%2Fjs-client-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiphands%2Fjs-client-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiphands%2Fjs-client-logger/lists"}