You need a mongodb instance running somewhere within reach.
- web.py
- thriftpy
- mongoengine
Unpack the archive somewhere on your computer.
To install the required Python packages:
$ make depends
This project relies heavily on environment variables for its configuration:
Variable name Default Description
-----------------------------------------------------------------------
MONGODB_HOST 127.0.0.1 MongoDB hostname
MONGODB_PORT 27017 MongoDB port
THRIFT_HOST 127.0.0.1 Thrift server bind hostname
THRIFT_PORT 6000 Thrift server bind port
THRIFT_FILE tracelogs.thrift Path to .thrift protocol file
Thrift server
$ make thriftserve
HTTP/JSON server
$ make webserve
To create buckets and list trace messages you need to use the thrift client:
$ python ./client.py --help
Example for creating a new bucket:
$ python ./client.py createBucket MyErrors
55a9108145816363ee84a40d
The token you get in return is used to submit and retrieve errors from server.
List error messages in bucket:
$ python ./client.py getTraces 55a9108145816363ee84a40d
[Trace(message=u'This is an error aswell', type=u'IOError', stack=[], context=u'')]
Submit error messages to your bucket using HTTP/JSON:
$ curl -i -X POST \
-H 'Token: 55a9108145816363ee84a40d' \
--data '{"message": "This is an error aswell", "type": "IOError"}' \
http://localhost:8080/traces