c7n.log module

class c7n.log.CloudWatchLogHandler(log_group='c7n.log', log_stream=None, session_factory=None)[source]

Bases: logging.Handler

Python Log Handler to Send to Cloud Watch Logs

https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html

batch_interval = 40
batch_min_buffer = 10
batch_size = 20
close()[source]

Tidy up any resources used by the handler.

This version removes the handler from an internal map of handlers, _handlers, which is used for handler lookup by name. Subclasses should ensure that this gets called from overridden close() methods.

emit(message)[source]

Send logs

flush()[source]

Ensure all logging output has been flushed.

flush_buffers(force=False)[source]
format_message(msg)[source]

format message.

start_transports()[source]

start thread transports.

class c7n.log.Error[source]

Bases: object

AlreadyAccepted = 'DataAlreadyAcceptedException'
InvalidToken = 'InvalidSequenceTokenException'
ResourceExists = 'ResourceAlreadyExistsException'
static code(e)[source]
class c7n.log.Transport(queue, batch_size, batch_interval, session_factory)[source]

Bases: object

create_stream(group, stream)[source]
loop()[source]
send()[source]
send_group(k, messages)[source]