marquee documentation

Contents:

marquee

marquee is a very simply Python logging formatter and handler to send log events as CloudWatch Events.

Features

  • simple log formatter
  • handler to send events to CloudWatch Events

Documentation

Documentation can be found at http://marquee.readthedocs.io/en/latest/.

Installation

Stable release

To install marquee, run this command in your terminal:

$ pip install marquee

This is the preferred method to install, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

From sources

The sources for marquee can be downloaded from the Github repo.

Clone the repository:

$ git clone git@github.com:theherk/marquee.git

Once you have a copy of the source, you can install it with:

$ python setup.py install

Usage

Handler

To use the handler, simply add it to you log:

import logging

from marquee.formatter import MarqueeFormatter
from marquee.handler import CloudWatchEventsHandler

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)

handler = CloudWatchEventsHandler()
log.addHandler(handler)

Formatter

To use the formatter, which is optional, add it to your handler. If you don’t use this formatter, __name__ will be used for the source in the handler. If you do, you can pass source too the handler along with any other formatter arguments. Then, this will be included in the CloudWatch Event.

To add the formatter to the handler:

fmt = MarqueeFormatter('theherk.testapp')
handler.setFormatter(fmt)

Contributing

Contribution are welcome. You can contribute in the following ways.

  • report bugs
  • fix bugs
  • implement features
  • write documentation
  • submit feedback

Get Started

Pull / Merge Request Guidelines

Credits

Core Developers

Contributors

marquee

marquee package

Submodules

marquee.formatter module

marquee logging formatter.

class marquee.formatter.MarqueeFormatter(source=None, *args, **kwargs)[source]

Bases: logging.Formatter

format(record)[source]

Overridden format method.

This will create a json object containing data for the CloudWatch Event.

class marquee.formatter.MarqueeEventFormatter(event_type=None, source=None, *args, **kwargs)[source]

Bases: logging.Formatter

format(record)[source]

Overridden format method. This will create a json object containing data for the CloudWatch Event.

marquee.handler module

marquee logging handler.

class marquee.handler.CloudWatchEventsHandler(session=None, detail_type=None, *args, **kwargs)[source]

Bases: logging.Handler

emit(record)[source]

Overridden emit method.

This will emit the log message to CloudWatch Events. Permissions and target account all set according to normal boto resolution.

Module contents

Indices and tables