Logging server
$ npm install 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.
GET /:curl 'http://localhost:3000/?token=secret&query=%7B%22format%22:%22string%22%7D'
Possible query params:
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.
POST /:curl -i \
-X POST \
-d '{"host":"localhost","data":"foo","format":"string"}' \
'http://localhost:3000/?token=secret'
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=jilo-server node cli.js --key=secret