django logs
Project description
provide http api for use of logging.handlers.HTTPHandler
save messages into db by asynchoronous,use celery
Quick start
Add “polls” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'django_http_logs', )
Include the polls URLconf in your project urls.py like this:
url(r'logs/', include('django_logs.urls')),
Run python manage.py migrate to create the http logs models.
Run python manage.py runserver 0.0.0.0:8080 and run celery worker(config celery self)
Start use http logging:
import time from logging.handlers import HTTPHandler logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) host = '127.0.0.1:8080' # django run port url = '/logs/apis/' handler = HTTPHandler(host, url, method='POST') logger.addHandler(handler) logger.debug("hello world")
Visit http://127.0.0.1:8080/admin to participate in the django_logs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-http-logs-1.0.1.tar.gz
(5.3 kB
view hashes)