Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

lastw/snitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

snitch

Periodically sends client-side logs to specified url.

  • Zero-dependency;
  • IE9+;
  • Cordova/PhoneGap apps compatible;
  • Easy integration with Segment.IO server HTTP API.

installation

bower install snitch

usage

var snitch = new Snitch('/path/to/log/service');

snitch.log('snitch enabled');

Full config:

var snitch = new Snitch({
  url: '/path/to/log/service', // do not forget about cross-origin policy
  interval: 1000 * 60 * 5, // send logs every 5 minutes
  ttl: 1000 * 60 * 24, // time to live
  solidMode: false, // weak consistency, do not try to send every single log
  capacity: 100 // how much log records could be stored before syncing to server
});

contribute

npm install
npm test

license

MIT.

About

Client-side log-sending tool

Resources

Stars

Watchers

Forks

Packages

No packages published