API Reference


Table of Contents


logtron_aws Module

autodiscover

def autodiscover(
  name=None,
  level=logging.INFO,
  **kwargs,
):
...

Returns:

  • A python logging.Logger instance configured for JSON logging.

Parameters:

ParameterDescription
nameThe name of the logger. This works exactly as with logging.getLogger(name).
levelThe log level as defined in the logging package.

The accepted keyword arguments are:

ParameterDescription
flattenIf True, Logtron will flatten the JSON logs so that nested entries like extra and context are flattened to top level JSON keys.
refreshForces re-initialization if set to True. Logtron will only initialize the first time autodiscover is called by default.
configExplicit Logtron configuration.
discover_configFunction to override the default configuration discovery process.
discover_contextFunction to override the default context discovery process.


Last updated 9/24/2020, 9:30:01 AM