Skip to main content

You can check the python-time, sql-time and query-count for each request for Django

Project description

Latest PyPI version

Getting Started

Django Action is can be check the python-time, sql-time and query-count for each requests for the Django Framework. Result outputs the log to file, console or fluentd.

https://raw.github.com/fujimisakari/django-actionlog/master/example/django-actionlog.png

Requirements

Django Actionlog requires Django 1.6 or later

fluent-logger 0.4.1 or later

Getting It

You can get Django Actionlog by using pip or easy_install:

$ pip install django-actionlog
or
$ easy_install django-actionlog

If you want to install it from source, grab the git repository from GitHub and run setup.py:

$ git clone git://github.com/fujimisakari/django-actionlog.git
$ cd django-actionlog
$ python setup.py install

Installing It

To enable django-actionlog in your project you need to add it to MIDDLEWARE_CLASSES and ACTION_LOG_SETTING in your projects settings.py file:

MIDDLEWARE = [
    ...
    'django_actionlog.middleware.ActionLogMiddleware',
    ...
]

# Action Log
ACTION_LOG_SETTING = {'handler_type': 'stdout'}

Using It

Case of output runserver console

ACTION_LOG_SETTING = {'handler_type': 'stdout'}

Case of output file

# default logfile: `/tmp/django_action.log`
ACTION_LOG_SETTING = {'handler_type': 'file', 'logfile': '/tmp/my_action.log'}

Case of output fluentd

# default host: `localhost`
# default port: `24224`
# default tag_name: `django.actionlog`
ACTION_LOG_SETTING = {'handler_type': 'fluentd', 'host': 'example.com', 'tag_name': 'my_service.foo'}

Case of want to output custom actionlog

from django_actionlog import actionlog

...
actionlog.output({'foo': 'bar', 'fizz': 'buzz'...})
...

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-actionlog-0.9.14.tar.gz (6.9 kB view details)

Uploaded Source

File details

Details for the file django-actionlog-0.9.14.tar.gz.

File metadata

File hashes

Hashes for django-actionlog-0.9.14.tar.gz
Algorithm Hash digest
SHA256 40e7bdf84f494a73105e935393edeb9cfe0b08ed681762c60b20484e1f6e41b0
MD5 cd6a5ea1c717b42be547c13ac2e001ba
BLAKE2b-256 6dd9b6ed8905df256554a9f6221309b15d9e5203b45eaff290e48adafc371668

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