Skip to main content

django opentracing SDK based on logger which focus on ease to use

Project description


django-opentracing-logger is a django opentracing SDK based on logger which focus on ease to use. This project mainly works now, but we need to do a little work to let it works with official opentracing since it was built for a dialect of opentracing schema(90% of the schema were the same).

1. install

# current 0.0.1
pip install django-opentracing-logger

2. config opentracing logger

from django_opentracing_logger.opentracing.tracer import set_log_tracer

# add request middleware

# add logger
    'filters': {
        'trace_id': {
            '()': 'django_opentracing_logger.opentracing.logging.TraceIDFilter',
    'formatters': {
        # ...,
        'trace': {
            '()': 'pythonjsonlogger.jsonlogger.JsonFormatter',
            'fmt': '%(message)s',
    'handlers': {
        # ...,
        'trace': {
            'level': 'INFO',
            'class': 'django_opentracing_logger.opentracing.logging.TraceHandler',
            'filename': '%s/trace.log' % '/data/logs/trace',
            'backupCount': 10,
            'when': 'D',
            'interval': 1,
            'formatter': 'trace'
    'loggers': {
        'tracer': {'handlers': ['trace'], 'propagate': True, 'level': 'DEBUG'},

# init tracer
    set_log_tracer("PROJECT_NAME") # TODO replace PROJECT_NAME with your real project name

3. collect

collect logs in /data/logs/trace

4. view

use any viewer which Compatible with opentracing.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-opentracing-logger, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django_opentracing_logger-0.0.2-py3-none-any.whl (13.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-opentracing-logger-0.0.2.tar.gz (11.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page