Skip to main content

django logs

Project description

provide http api for use of logging.handlers.HTTPHandler

save messages into db by asynchoronous,use celery

Quick start

  1. Add “polls” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'django_http_logs',
    )
  2. Include the polls URLconf in your project urls.py like this:

    url(r'logs/', include('django_logs.urls')),
  3. Run python manage.py migrate to create the http logs models.

  4. Run python manage.py runserver 0.0.0.0:8080 and run celery worker(config celery self)

  5. 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")
  6. Visit http://127.0.0.1:8080/admin to participate in the django_logs.

Project details


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.8.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file django-http-logs-1.0.8.tar.gz.

File metadata

  • Download URL: django-http-logs-1.0.8.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for django-http-logs-1.0.8.tar.gz
Algorithm Hash digest
SHA256 045dbfd2487a9c6d4480f7ff7284836cf8212e91fec776524c23c5da28dc4e74
MD5 98d6c6c5738ef67638be1eaf23f9c678
BLAKE2b-256 720add94b85fdf645c6a59b65b069738f7a9d01baa9ec381c8e7d889a18e4801

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page