Metadata-Version: 2.1
Name: socket-log-receiver
Version: 20.4.1a0
Summary: A light-weight socket log receiver
Home-page: https://github.com/okomestudio/socket-log-receiver
Author: Taro Sato
Author-email: okomestudio@gmail.com
License: MIT
Description: [![pyversion Status](https://img.shields.io/pypi/pyversions/socket-log-receiver.svg)](https://img.shields.io/pypi/pyversions/socket-log-receiver.svg)
        [![CircleCI](https://circleci.com/gh/okomestudio/socket-log-receiver.svg?style=shield)](https://circleci.com/gh/okomestudio/socket-log-receiver)
        [![Coverage Status](https://coveralls.io/repos/github/okomestudio/socket-log-receiver/badge.svg?branch=development)](https://coveralls.io/github/okomestudio/socket-log-receiver?branch=development&kill_cache=1)
        [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
        
        
        # Socket Log Receiver
        
        `socket_log_receiver` is a light-weight socket log receiver. It runs
        as a server and aggregates messages from multi-process application via
        socket and logs to a single file. Python's `logging` package does not
        support logging to a single file from multiple processes. By pointing
        `SocketHandler` to `socket_log_receiver`, the multi-process
        application can log to a single file.
        
        
        ## Installation
        
        ``` bash
        $ pip install socket-log-receiver
        ```
        
        
        ## Basic Usage
        
        The receiver service should be run as a service.
        
        ``` bash
        $ python -m socket_log_receiver  # as a module
        $ log_receiver                   # as a command-line program
        ```
        
        In the application, use `SocketHandler` to send logs to the receiver
        service.
        
        ``` python
        from logging.handlers import SocketHandler
        
        handler = SocketHandler('localhost', 9020)  # handler to send logs to localhost:9020
        logging.root.addHandler(handler)            # add the socket handler to the root logger
        ```
        
        This way, the root logger sends logging messages to the receiver service.
        
        
        ## Development
        
        ```bash
        $ pip install -e .[dev]
        $ pre-commit install
        ```
        
        
        ### Running Tests
        
        ``` bash
        $ python setup.py tests
        ```
        
Platform: Linux
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Utilities
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Provides-Extra: dev
Provides-Extra: test
