{"repo":"joaodrp/gelf-formatter","free":true,"listed":false,"github":"https://github.com/joaodrp/gelf-formatter","clone":"git clone https://github.com/joaodrp/gelf-formatter.git","description":"GELF formatter for the Python standard library logging module.","language":"Python","stars":10,"topics":["python","logging","gelf","graylog","formatter","log"],"license":"MIT","category":"dev-tools","readme_excerpt":"GELF Formatter Graylog Extended Log Format (GELF) formatter for the Python standard library logging module --- Motivation There are several packages available providing handlers for the standard library logging module that can send application logs to Graylog over TCP/UDP/HTTP (py-gelf is a good example). Although these can be useful, it's not ideal to make an application performance dependent on network requests just for the purpose of delivering logs. Alternatively, one can simply log to a file or stdout and have a collector (like Fluentd) processing and sending those logs asynchronously to a remote server (and not just to Graylog, as GELF can be used as a generic log format), which is a common pattern for containerized applications. In a scenario like this all we need is a GELF logging formatter . Features - Support for arbitrary additional fields - Support for including reserved logging.LogRecord attributes as additional fields - Exceptions detection with traceback formatting - Full type annotations (PEP 561 compatible) - Zero dependencies and tiny footprint Installation Usage Create a GelfFormatter instance and pass it to logging.Handler.setFormatter : Apply it globally with logging.basicConfig to automatically format log records from third-party packages as well: Alternatively, configure a local logging.Logger instance through logging.Logger.addHandler : That's it. You can now use the logging module as usual, all records will be formatted as GELF messages. Standard Fiel","default_branch":null,"files":null,"tree":[],"storefront":"/r/joaodrp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/joaodrp/gelf-formatter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}