semvec/pypi-packages huggingface dataset:
docker-storage 0.0.1
Utilities to work with docker data containers
License: MIT

==============
Docker storage
==============

Project information:

.. image:: https://img.shields.io/pypi/v/docker-storage.svg
   :target: https://pypi.python.org/pypi/docker-storage

.. image:: https://img.shields.io/pypi/dm/docker-storage.svg
   :target: https://pypi.python.org/pypi/docker-storage

.. image:: https://img.shields.io/badge/docs-TODO-lightgrey.svg
   :target: http://docker-storage.readthedocs.org/en/latest/

.. image:: https://img.shields.io/pypi/l/docker-storage.svg
   :target: https://github.com/GaretJax/docker-storage/blob/master/LICENSE

Automated code metrics:

.. image:: https://img.shields.io/travis/GaretJax/docker-storage.svg
   :target: https://travis-ci.org/GaretJax/docker-storage

.. image:: https://img.shields.io/coveralls/GaretJax/docker-storage/master.svg
   :target: https://coveralls.io/r/GaretJax/docker-storage?branch=master

.. image:: https://img.shields.io/codeclimate/github/GaretJax/docker-storage.svg
   :target: https://codeclimate.com/github/GaretJax/docker-storage

.. image:: https://img.shields.io/requires/github/GaretJax/docker-storage.svg
   :target: https://requires.io/github/GaretJax/docker-storage/requirements/?branch=master

``docker-storage`` is a command line tool and a library to easily manage Docker
data-only containers

* Free software: MIT license
* Documentation: http://docker-storage.rtfd.org (TODO)


Installation
============

::

  pip install docker-storage


Command line usage
==================

::

   $ docker-storage box create test-box /data

   $ docker-storage box
   Name      Path
   --------  ------
   test-box  /data

   $ docker-storage box exec test-box -- touch EXAMPLE

   $ docker-storage box ls test-box
   total 8
   drwxr-xr-x    2 root     root          4096 Sep 23 07:45 .
   drwxr-xr-x   30 root     root          4096 Sep 23 07:45 ..
   -rw-r--r--    1 root     root             0 Sep 23 07:45 EXAMPLE

   $ docker-storage box rm test-box

   $ docker-storage box
   Name    Path
   ------  ------


=======
History
=======


0.0.1 - 2015-09-23
==================

* Initial version
json-logging-py 0.2
JSON / Logstash formatters for Python logging
License: MIT
Keywords: json,logging,logstash

JSON logging for Python |PyPi version|
======================================

This library provides Python logging formatters to output JSON, 2
formatters are specific for Logstash message format version 0 or 1.

Installation
============

Using pip:

::

    pip install json-logging-py

From source:

::

    python setup.py install

Usage
=====

The name of the library is ``jsonlogging``, it provides 3 formatters:

JSONFormatter
-------------

::

    {
        "tags": [
            "env=prod",
            "role=www"
        ],
        "timestamp": "2015-09-22T22:40:56.178715Z",
        "level": "ERROR",
        "host": "server-01.example.com",
        "path": "example.py",
        "message": "hello world!",
        "logger": "root"
    }

LogstashFormatterV0
-------------------

::

    {
        "@source": "JSON://server-01.example.com/example.py",
        "@source_host": "server-01.example.com",
        "@message": "hello world!",
        "@tags": [
            "env=prod",
            "role=www"
        ],
        "@fields": {
            "logger": "root",
            "levelname": "ERROR"
        },
        "@timestamp": "2015-09-22T22:42:02.094525Z",
        "@source_path": "example.py",
        "@type": "JSON"
    }

LogstashFormatterV1
-------------------

::

    {
        "host": "server-01.example.com",
        "logger": "root",
        "type": "JSON",
        "tags": [
            "env=prod",
            "role=www"
        ],
        "path": "example.py",
        "@timestamp": "2015-09-22T22:43:11.966558Z",
        "@version": 1,
        "message": "hello world!",
        "levelname": "ERROR"
    }

Python example
--------------

::

    import logging
    import jsonlogging


    logger = logging.getLogger()

    logHandler = logging.StreamHandler()

    # You can also use LogstashFormatterV0 or LogstashFormatterV1
    formatter = jsonlogging.JSONFormatter(
        hostname="server-01.example.com"
        tags=["env=prod", "role=www"],
        indent=4)
    logHandler.setFormatter(formatter)

    logger.addHandler(logHandler)

    # You can pass additional tags
    logger.error('hello world!', extra={"tags": ["hello=world"]})

.. |PyPi version| image:: https://img.shields.io/pypi/v/json-logging-py.svg
   :target: https://pypi.python.org/pypi/json-logging-py/
py2loggly 1.1.2
A proxy for python UDP/TCP logging to loggly
License: MIT
Keywords: loggly,logging

Py2Loggly
=========

Py2Loggly is a proxy server listening on UDP and TCP for messages coming
from python's UDP/TCP logging handler, it will forward all these
messages to ``loggly.com``.

Installation
------------

Install dependencies
~~~~~~~~~~~~~~~~~~~~

py2loggly only depends on ``gevent``

Install py2loggly
~~~~~~~~~~~~~~~~~

From sources

::

    $ python setup.py install

From Pypi

::

    $ pip install py2loggly

Usage
-----

Starting the server
~~~~~~~~~~~~~~~~~~~

The only required parameter is ``--loggly-token`` to provide your loggly
TOKEN.

::

    $ py2loggly --loggly-token $LOGGLY_TOKEN

The default TCP port is 9020 and the default UDP port is 9021.

Parameters
^^^^^^^^^^

::

    usage: py2loggly [-h] [-v] [--bind-ip IP] [--tcp-port PORT] [--udp-port PORT]
                     [--fqdn] [--hostname HOSTNAME] --loggly-token TOKEN
                     [--tags TAG1 TAG2 [TAG1 TAG2 ...]]

    Proxy for python UDP/TCP logging to loggly

    optional arguments:
      -h, --help            show this help message and exit
      -v, --version         show program's version number and exit
      --bind-ip IP          IP address to listen on
      --tcp-port PORT       TCP port to listen on
      --udp-port PORT       UDP port to listen on
      --fqdn                Use the fully qualified domain name
      --hostname HOSTNAME   Use the provided hostname instead of guessing it.
      --loggly-token TOKEN  the loggly TOKEN.
      --tags TAG1 TAG2 [TAG1 TAG2 ...]
                            Tags for the event message

Sending messages to py2loggly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can either use ``SockerHandler`` or ``DatagramHandler`` from
python's ``logging.handlers``

The biggest advantage to use ``DatagramHandler`` is that logging won't
slow down your application and if py2loggly is not running, it won't
impact your application.

So the recommended setup is to run py2loggly locally on each server and
use the ``DatadgramHandler``.

Example
^^^^^^^

::

    import logging, logging.handlers

    rootLogger = logging.getLogger('')
    rootLogger.setLevel(logging.DEBUG)
    socketHandler = logging.handlers.SocketHandler('localhost',
                        logging.handlers.DEFAULT_TCP_LOGGING_PORT)
    # don't bother with a formatter, since a socket handler sends the event as
    # an unformatted pickle
    rootLogger.addHandler(socketHandler)

    # Now, we can log to the root logger, or any other logger. First the root...
    logging.info('Jackdaws love my big sphinx of quartz.')

License
-------

MIT