node package manager


Logging server


Logging server

$ npm install -g jilo-server

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.

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"}' \


  format: 'json',
  timestamp: '2013-01-01T00:00:00.000Z'
  id: 123,
  level: 'info',
  user: 123,
  host: '',
  group: 'web',
  responseTime: 23,
  version: '1.7.1',
  data: {
    foo: 'bar'
DEBUG=jilo-server node cli.js --key=secret