The synaps.log Module

Synaps logging handler.

This module adds to logging functionality by adding the option to specify a context object when calling the various log methods. If the context object is not specified, default formatting is used. Additionally, an instance uuid may be passed as part of the log message, which is intended to make it easier for admins to find messages related to a specific instance.

It also allows setting of formatting information through flags.

class JSONFormatter(fmt=None, datefmt=None)

Bases: logging.Formatter

format(record)
formatException(ei, strip_newlines=True)
class LegacyNovaFormatter(fmt=None, datefmt=None)

Bases: logging.Formatter

A synaps.context.RequestContext aware formatter configured through flags.

The flags used to set format strings are: logging_context_format_string and logging_default_format_string. You can also specify logging_debug_format_suffix to append extra formatting if the log level is debug.

For information about what variables are available for the formatter see: http://docs.python.org/library/logging.html#formatter

format(record)

Uses contextstring if request_id is set, otherwise default.

formatException(exc_info, record=None)

Format exception output with FLAGS.logging_exception_prefix.

class PublishErrorsHandler(level=0)

Bases: logging.Handler

emit(record)
class StormFormatter(fmt=None, datefmt=None)

Bases: synaps.log.LegacyNovaFormatter

format(record)

Uses contextstring if request_id is set, otherwise default.

class StormLogHandler(level=0)

Bases: logging.Handler

emit(record)
class SynapsContextAdapter(logger)

Bases: logging.LoggerAdapter

audit(msg, *args, **kwargs)
process(msg, kwargs)
warn(msg, *args, **kwargs)

Delegate a warning call to the underlying logger, after adding contextual information from this adapter instance.

class WritableLogger(logger, level=20)

Bases: object

A thin wrapper that responds to write and logs.

write(msg)
getLogger(name='synaps')
handle_exception(type, value, tb)
setup()

Setup synaps logging.

setup_storm()

Previous topic

The synaps.local Module

Next topic

The synaps.monitor.api Module

This Page