Search Results for

    Show / Hide Table of Contents

    Namespace AWS.Lambda.Powertools.Logging

    Classes

    CorrelationIdPaths

    Supported Event types from which Correlation ID can be extracted

    LogBufferingOptions

    Configuration options for log buffering

    LogEntry

    Powertools Log Entry

    LogEntryLambdaContext

    Powertools Log Entry Lambda Context

    LogFormatException

    Exception thrown when LogFormatter returns invalid object or error:

    Logger

    Class Logger.

    LoggingAttribute

    Provides a Lambda optimized logger with output structured as JSON.

    Key features
    ---------------------

    • Capture key fields from Lambda context and cold start
    • Log Lambda event when instructed (disabled by default)
    • Log sampling enables DEBUG log level for a percentage of requests (disabled by default)
    • Append additional keys to structured log at any point in time

    Environment variables
    ---------------------
    Variable nameDescription
    POWERTOOLS_SERVICE_NAMEstring, service name
    POWERTOOLS_LOG_LEVELstring, logging level (e.g. Information, Debug, and Trace)
    POWERTOOLS_LOGGER_CASEstring, logger output case (e.g. CamelCase, PascalCase, and SnakeCase)
    POWERTOOLS_LOGGER_SAMPLE_RATEdouble, sampling rate ranging from 0 to 1, 1 being 100% sampling

    Parameters
    -----------
    Parameter nameDescription
    Servicestring, service name to be appended in logs, by default "service_undefined"
    LogLevelenum, logging level (e.g. Information, Debug, and Trace), by default Information
    LoggerOutputCaseenum, logger output case (e.g. CamelCase, PascalCase, and SnakeCase)
    SamplingRatedouble, sample rate for debug calls within execution context defaults to 0.0
    CorrelationIdPathstring, pointer path to extract correlation id from input parameter
    ClearStatebool, clear all custom keys on each request, by default false

    PowertoolsLoggerBuilder

    Builder class for creating configured PowertoolsLogger instances. Provides a fluent interface for configuring logging options.

    PowertoolsLoggerConfiguration

    Configuration for the Powertools Logger.

    PowertoolsLoggerExtensions

    Class LoggerExtensions.

    PowertoolsLoggerFactoryExtensions

    Extensions for ILoggerFactory

    PowertoolsLoggingBuilderExtensions

    Extension methods to configure and add the Powertools logger to an ILoggingBuilder.

    Interfaces

    ILogFormatter

    Represents a type used to format Powertools log entries.

    Enums

    LoggerOutputCase

    Enum LoggerOutputCase

    In this article
    Back to top Powertools for AWS Lambda (.NET) API Documentation