Metadata-Version: 1.1
Name: django-opentracing-logger
Version: 0.0.2
Summary: django opentracing SDK based on logger which focus on ease to use
Home-page: https://github.com/FingerLiu/django-opentracing-logger
Author: liupeng
Author-email: liupeng@luojilab.com
License: BSD License
Description: opentracing python SDK
        ======================
        
        
        0. TODO
        ----------
        
        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
        ----------
        
        .. code:: bash
        
           # current 0.0.1
           pip install django-opentracing-logger
        
        2. config opentracing logger
        ----------------------------
        
        .. code:: python
        
           # settings.py
           from django_opentracing_logger.opentracing.tracer import set_log_tracer
        
           # add request middleware
           MIDDLEWARE = [
               'django_opentracing_logger.opentracing.middleware.DDTracerMiddleware',
           ]
        
           # add logger
           LOGGING = {
               '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
           APM_ENABLE = True
           if APM_ENABLE:
               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.
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: System :: Distributed Computing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
