AWS IoT

2025/12/19 - AWS IoT - 2 updated api methods

Changes  This release adds event-based logging feature that enables granular event logging controls for AWS IoT logs.

GetV2LoggingOptions (updated) Link ¶
Changes (request, response)
Request
{'verbose': 'boolean'}
Response
{'eventConfigurations': [{'eventType': 'string',
                          'logDestination': 'string',
                          'logLevel': 'DEBUG | INFO | ERROR | WARN | '
                                      'DISABLED'}]}

Gets the fine grained logging options.

Requires permission to access the GetV2LoggingOptions action.

See also: AWS API Documentation

Request Syntax

client.get_v2_logging_options(
    verbose=True|False
)
type verbose:

boolean

param verbose:

The flag is used to get all the event types and their respective configuration that event-based logging supports.

rtype:

dict

returns:

Response Syntax

{
    'roleArn': 'string',
    'defaultLogLevel': 'DEBUG'|'INFO'|'ERROR'|'WARN'|'DISABLED',
    'disableAllLogs': True|False,
    'eventConfigurations': [
        {
            'eventType': 'string',
            'logLevel': 'DEBUG'|'INFO'|'ERROR'|'WARN'|'DISABLED',
            'logDestination': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • roleArn (string) --

      The IAM role ARN IoT uses to write to your CloudWatch logs.

    • defaultLogLevel (string) --

      The default log level.

    • disableAllLogs (boolean) --

      Disables all logs.

    • eventConfigurations (list) --

      The list of event configurations that override account-level logging.

      • (dict) --

        Configuration for event-based logging that specifies which event types to log and their logging settings. Used for account-level logging overrides.

        • eventType (string) --

          The type of event to log. These include event types like Connect, Publish, and Disconnect.

        • logLevel (string) --

          The logging level for the specified event type. Determines the verbosity of log messages generated for this event type.

        • logDestination (string) --

          CloudWatch Log Group for event-based logging. Specifies where log events should be sent. The log destination for event-based logging overrides default Log Group for the specified event type and applies to all resources associated with that event.

SetV2LoggingOptions (updated) Link ¶
Changes (request)
{'eventConfigurations': [{'eventType': 'string',
                          'logDestination': 'string',
                          'logLevel': 'DEBUG | INFO | ERROR | WARN | '
                                      'DISABLED'}]}

Sets the logging options for the V2 logging service.

Requires permission to access the SetV2LoggingOptions action.

See also: AWS API Documentation

Request Syntax

client.set_v2_logging_options(
    roleArn='string',
    defaultLogLevel='DEBUG'|'INFO'|'ERROR'|'WARN'|'DISABLED',
    disableAllLogs=True|False,
    eventConfigurations=[
        {
            'eventType': 'string',
            'logLevel': 'DEBUG'|'INFO'|'ERROR'|'WARN'|'DISABLED',
            'logDestination': 'string'
        },
    ]
)
type roleArn:

string

param roleArn:

The ARN of the role that allows IoT to write to Cloudwatch logs.

type defaultLogLevel:

string

param defaultLogLevel:

The default logging level.

type disableAllLogs:

boolean

param disableAllLogs:

If true all logs are disabled. The default is false.

type eventConfigurations:

list

param eventConfigurations:

The list of event configurations that override account-level logging.

  • (dict) --

    Configuration for event-based logging that specifies which event types to log and their logging settings. Used for account-level logging overrides.

    • eventType (string) -- [REQUIRED]

      The type of event to log. These include event types like Connect, Publish, and Disconnect.

    • logLevel (string) --

      The logging level for the specified event type. Determines the verbosity of log messages generated for this event type.

    • logDestination (string) --

      CloudWatch Log Group for event-based logging. Specifies where log events should be sent. The log destination for event-based logging overrides default Log Group for the specified event type and applies to all resources associated with that event.

returns:

None