-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
67 lines (52 loc) · 2.03 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|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 <http://pysllo.readthedocs.io/>`__.
Quick start
-----------
.. code:: bash
pip install pysllo
Features
--------
- StructuredLogger
- PropagationLogger
- TrackingLogger
- JsonFormatter
- ElasticSearchUDPHandler
Example
-------
.. code:: python
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)
.. |Documentation Status| image:: https://readthedocs.org/projects/pysllo/badge/?version=latest
:target: http://pysllo.readthedocs.io/en/latest/?badge=latest
.. |Coverage Status| image:: https://coveralls.io/repos/github/kivio/pysllo/badge.svg?branch=master
:target: https://coveralls.io/github/kivio/pysllo?branch=master
.. |Build Status| image:: https://travis-ci.org/kivio/pysllo.svg?branch=master
:target: https://travis-ci.org/kivio/pysllo