jilo-server

0.1.2 • Public • Published

jilo

Logging server

Install

$ npm install -g jilo-server

Setup

Create a capped collection in Mongo:

> db.createCollection('log', { capped: true, size: 100000 })

For more info, see the MongoDB documentation.

Start the server:

$ jilo-server --key=secret [options]

All clients must connect to the server using the token secret.

By default the server will start on port 3000 and connect to a database named jilo on localhost.

API

Query the server GET /:

curl 'http://localhost:3000/?token=secret&query=%7B%22format%22:%22string%22%7D'

Possible query params:

  • query
  • filter
  • sort
  • skip
  • limit

The server will stream log entries to the client as they are logged (kind of like the lovely tail -f). Note: If you use either sort or limit streaming will be disabled for obvious reasons.

Send a log entry to the server POST /:

curl -i \
     -X POST \
     -d '{"host":"localhost","data":"foo","format":"string"}' \
     'http://localhost:3000/?token=secret'

JSON format

Example:

{
  format: 'json',
  timestamp: '2013-01-01T00:00:00.000Z'
  id: 123,
  level: 'info',
  user: 123,
  host: 'example.com',
  group: 'web',
  responseTime: 23,
  version: '1.7.1',
  data: {
    foo: 'bar'
  }
}

Debug

DEBUG=jilo-server node cli.js --key=secret

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    2
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i jilo-server

Weekly Downloads

2

Version

0.1.2

License

MIT

Last publish

Collaborators

  • watson