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 name | Description |
---|---|
POWERTOOLS_SERVICE_NAME | string, service name |
POWERTOOLS_LOG_LEVEL | string, logging level (e.g. Information, Debug, and Trace) |
POWERTOOLS_LOGGER_CASE | string, logger output case (e.g. CamelCase, PascalCase, and SnakeCase) |
POWERTOOLS_LOGGER_SAMPLE_RATE | double, sampling rate ranging from 0 to 1, 1 being 100% sampling |
Parameters
-----------
Parameter name | Description |
---|---|
Service | string, service name to be appended in logs, by default "service_undefined" |
LogLevel | enum, logging level (e.g. Information, Debug, and Trace), by default Information |
LoggerOutputCase | enum, logger output case (e.g. CamelCase, PascalCase, and SnakeCase) |
SamplingRate | double, sample rate for debug calls within execution context defaults to 0.0 |
CorrelationIdPath | string, pointer path to extract correlation id from input parameter |
ClearState | bool, 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