Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hojberg/spongelog
Log UI Events
https://github.com/hojberg/spongelog
Last synced: 29 days ago
JSON representation
Log UI Events
- Host: GitHub
- URL: https://github.com/hojberg/spongelog
- Owner: hojberg
- Created: 2013-05-17T16:14:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-25T18:34:37.000Z (over 10 years ago)
- Last Synced: 2024-04-14T19:07:53.758Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 398 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
SpongeLog
=========[![Build Status](https://travis-ci.org/hojberg/spongelog.png)](https://travis-ci.org/hojberg/spongelog)
Ain't got no square pants
## How to use SpongeLog
Simply instantiate spongelog to begin collecting log and error events:
```javascript
new SpongeLog({
url: 'http://theserverurl'
});
```### Manually record events
```javascript
var spongeLog = new SpongeLog({
url: 'http://theserverurl'
});spongeLog.record({
name: '',
source: '',
message: '',
occuredAt: new Date()
});
```### Manually flush back to the server
```javascript
var spongeLog = new SpongeLog({
url: 'http://theserverurl'
});spongeLog.flush();
```### Set the flush frequency
Default is `20000` (20 seconds)```javascript
var spongeLog = new SpongeLog({
url: 'http://theserverurl',
flushFrequency: 4000
});
```### Add session data to each event
```javascript
var spongeLog = new SpongeLog({
url: 'http://theserverurl',
sessionData: {
userId: '32AS432SX'
}
});
```