django-logs-aggregator
Installation
$ pip3 install virtualenv
$ virtualenv -p python3 myenv && cd myenv
activate virtual environment
$ source bin/activate
clone
$ git clone https://github.com/karimabdelhakim/django-logs-aggregator.git
$ cd django-logs-aggregator
install requirements
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py runserver
Usage
go to http://127.0.0.1:8000/
Register and login then you will be redirected to all logs view where you can search by server name
get a token
$ curl -X POST http://localhost:8000/api/auth/token/ -H 'content-type: application/json' -d '{"username": "myusername","password": "mypass"}'
example response: {"token":"<token_value>"}
make a log with token and data
$ curl -X POST http://localhost:8000/api/logs/create/ -H 'authorization: JWT <your_token>' -H 'content-type: application/json' -d '{ "type": "warning", "message": "some message", "text":"some text", "server_name":"my_server" }'
"type":must be "info", "warning" or "error" (required)
"message": log message (required)
"text": extra text (optional)
"server_name":required