shipper Package

shipper Package

class tagalog.shipper.NullShipper

Bases: tagalog.shipper.ishipper.IShipper

ship(msg)
tagalog.shipper.build_null(*args, **kwargs)
tagalog.shipper.build_redis(*args, **kwargs)
tagalog.shipper.build_shipper(description)

Takes a command-line description of a shipper and build the relevant shipper from it

tagalog.shipper.build_statsd_counter(*args, **kwargs)
tagalog.shipper.build_statsd_timer(*args, **kwargs)
tagalog.shipper.build_stdout(*args, **kwargs)
tagalog.shipper.get_shipper(name)
tagalog.shipper.parse_shipper(description)
tagalog.shipper.register_shipper(name, constructor)
tagalog.shipper.str2bool(s)
tagalog.shipper.unregister_shipper(name)

formatter Module

tagalog.shipper.formatter.elasticsearch_bulk_decorate(bulk_index, bulk_type, msg)

Decorates the msg with elasticsearch bulk format and adds index and message type

tagalog.shipper.formatter.format_as_elasticsearch_bulk_json(bulk_index, bulk_type, msg)
tagalog.shipper.formatter.format_as_json(msg)

ishipper Module

class tagalog.shipper.ishipper.IShipper

Bases: object

Abstract class representing a log shipper. Log shippers should implement the following methods:

ship(message)

redis Module

class tagalog.shipper.redis.RedisShipper(urls, key='logs', bulk=False, bulk_index='logs', bulk_type='message')

Bases: tagalog.shipper.ishipper.IShipper

ship(msg)
class tagalog.shipper.redis.ResilientStrictRedis(host='localhost', port=6379, db=0, password=None, socket_timeout=None, connection_pool=None, charset='utf-8', errors='strict', decode_responses=False, unix_socket_path=None)

Bases: redis.client.StrictRedis

execute_command(*args, **options)

Execute a command and return a parsed response

execution_attempts
class tagalog.shipper.redis.RoundRobinConnectionPool(patterns=None, max_connections_per_pattern=None, connection_class=<class 'redis.connection.Connection'>)

Bases: object

Round-robin Redis connection pool

add_pattern(pattern)
all_connections()

Returns a generator over all current connection objects

disconnect()

Disconnect all connections in the pool

get_connection(command_name, *keys, **options)

Get a connection from the pool

make_connection()

Create a new connection

purge(connection)

Remove the connection from rotation

release(connection)

Releases the connection back to the pool

remove_pattern(pattern)

shipper_error Module

exception tagalog.shipper.shipper_error.ShipperError

Bases: exceptions.Exception

statsd Module

class tagalog.shipper.statsd.StatsdShipper(metric, host='127.0.0.1', port='8125')

Bases: tagalog.shipper.ishipper.IShipper

ship(msg)
tagalog.shipper.statsd.get_from_msg(field, msg)

stdout Module

class tagalog.shipper.stdout.StdoutShipper(bulk=False, bulk_index='logs', bulk_type='message')

Bases: tagalog.shipper.ishipper.IShipper

ship(msg)