Skip to content
/ pysllo Public

Make your python logging more structured and easy to aggregate

License

Notifications You must be signed in to change notification settings

kivio/pysllo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI PyPI Documentation Status Coverage Status Build Status

Pysllo

Pysllo is set of useful python logging extenders that give possibility to bind additional data to logs, raising all logs if error occurs or flow tracks with tools like Elastic Stack or other monitoring tools based on document databases.

The most important benefit of using pysllo is that it's is just extension to normal python logging library. It not requiring from you to change whole logs implementation in your application. You can easy change just part of logging configuration and use this tool in that part of code. It's really simple to start working with Pysllo.

For more information go to documentation on ReadTheDocs.

Quick start

pip install pysllo

Features

  • StructuredLogger
  • PropagationLogger
  • TrackingLogger
  • JsonFormatter
  • ElasticSearchUDPHandler

Example

from pysllo.handlers import ElasticSearchUDPHandler
from pysllo.formatters import JsonFormatter
from pysllo.utils import LoggersFactory

# configuration
host, port = 'localhost', 9000
handler = ElasticSearchUDPHandler([(host, port)])
formatter = JsonFormatter()
handler.setFormatter(formatter)
MixedLogger = LoggersFactory.make(
        tracking_logger=True,
        propagation_logger=True,
        structured_logger=True
    )
logger = MixedLogger('test')
logger.addHandler(handler)
    
# examlpe usage
msg = "TEST"
logger.bind(ip='127.0.0.1')
logger.debug(msg, user=request.user)

About

Make your python logging more structured and easy to aggregate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages