Skip to content

configure_logs_for_playback_configuration

configure_logs_for_playback_configuration(
    percent_enabled: __integer,
    playback_configuration_name: __string,
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    enabled_logging_strategies: Optional[__listOfLoggingStrategies] = None,
    ads_interaction_log: Optional[AdsInteractionLog] = None,
    manifest_service_interaction_log: Optional[ManifestServiceInteractionLog] = None,
) -> ConfigureLogsForPlaybackConfigurationResponse

Defines where AWS Elemental MediaTailor sends logs for the playback configuration.

Parameters:

  • percent_enabled (__integer) –

    The percentage of session logs that MediaTailor sends to your CloudWatch Logs account. For example, if your playback configuration has 1000 sessions and percentEnabled is set to 60, MediaTailor sends logs for 600 of the sessions to CloudWatch Logs. MediaTailor decides at random which of the playback configuration sessions to send logs for. If you want to view logs for a specific session, you can use the debug log mode.

    Valid values: 0 - 100

  • playback_configuration_name (__string) –

    The name of the playback configuration.

  • enabled_logging_strategies (Optional[__listOfLoggingStrategies], default: None ) –

    The method used for collecting logs from AWS Elemental MediaTailor. To configure MediaTailor to send logs directly to Amazon CloudWatch Logs, choose LEGACY_CLOUDWATCH. To configure MediaTailor to send logs to CloudWatch, which then vends the logs to your destination of choice, choose VENDED_LOGS. Supported destinations are CloudWatch Logs log group, Amazon S3 bucket, and Amazon Data Firehose stream.

    To use vended logs, you must configure the delivery destination in Amazon CloudWatch, as described in Enable logging from AWS services, Logging that requires additional permissions [V2].

  • ads_interaction_log (Optional[AdsInteractionLog], default: None ) –

    The event types that MediaTailor emits in logs for interactions with the ADS.

  • manifest_service_interaction_log (Optional[ManifestServiceInteractionLog], default: None ) –

    The event types that MediaTailor emits in logs for interactions with the origin server.

Raises:

Source code in docs_src/capo_mediatailor/_services/media_tailor.py
def configure_logs_for_playback_configuration(
    self,
    percent_enabled: "capo_mediatailor.types.__integer.__integer",
    playback_configuration_name: "capo_mediatailor.types.__string.__string",
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    enabled_logging_strategies: Optional[
        "capo_mediatailor.types.__list_of_logging_strategies.__listOfLoggingStrategies"
    ] = None,
    ads_interaction_log: Optional[
        "capo_mediatailor.types.ads_interaction_log.AdsInteractionLog"
    ] = None,
    manifest_service_interaction_log: Optional[
        "capo_mediatailor.types.manifest_service_interaction_log.ManifestServiceInteractionLog"
    ] = None,
) -> "capo_mediatailor.types.configure_logs_for_playback_configuration_response.ConfigureLogsForPlaybackConfigurationResponse":
    """<p>Defines where AWS Elemental MediaTailor sends logs for the playback configuration.</p>

    Args:
        percent_enabled: <p>The percentage of session logs that MediaTailor sends to your CloudWatch Logs account. For example, if your playback configuration has 1000 sessions and percentEnabled is set to <code>60</code>, MediaTailor sends logs for 600 of the sessions to CloudWatch Logs. MediaTailor decides at random which of the playback configuration sessions to send logs for. If you want to view logs for a specific session, you can use the <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/debug-log-mode.html">debug log mode</a>.</p> <p>Valid values: <code>0</code> - <code>100</code> </p>
        playback_configuration_name: <p>The name of the playback configuration.</p>
        enabled_logging_strategies: <p>The method used for collecting logs from AWS Elemental MediaTailor. To configure MediaTailor to send logs directly to Amazon CloudWatch Logs, choose <code>LEGACY_CLOUDWATCH</code>. To configure MediaTailor to send logs to CloudWatch, which then vends the logs to your destination of choice, choose <code>VENDED_LOGS</code>. Supported destinations are CloudWatch Logs log group, Amazon S3 bucket, and Amazon Data Firehose stream.</p> <p>To use vended logs, you must configure the delivery destination in Amazon CloudWatch, as described in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions-V2">Enable logging from AWS services, Logging that requires additional permissions [V2]</a>.</p>
        ads_interaction_log: <p>The event types that MediaTailor emits in logs for interactions with the ADS.</p>
        manifest_service_interaction_log: <p>The event types that MediaTailor emits in logs for interactions with the origin server.</p>

    Raises:
        capo_mediatailor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediatailor.types.configure_logs_for_playback_configuration_request.ConfigureLogsForPlaybackConfigurationRequest]",
    ) -> OperationResponse[
        "capo_mediatailor.types.configure_logs_for_playback_configuration_response.ConfigureLogsForPlaybackConfigurationResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.configure_logs_for_playback_configuration

        output, http_response = (
            capo_mediatailor._operations.media_tailor.configure_logs_for_playback_configuration.configure_logs_for_playback_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ConfigureLogsForPlaybackConfiguration")
    )
    input_: capo_mediatailor.types.configure_logs_for_playback_configuration_request.ConfigureLogsForPlaybackConfigurationRequest = {
        "percent_enabled": percent_enabled,
        "playback_configuration_name": playback_configuration_name,
    }
    if enabled_logging_strategies is not None:
        input_["enabled_logging_strategies"] = enabled_logging_strategies
    if ads_interaction_log is not None:
        input_["ads_interaction_log"] = ads_interaction_log
    if manifest_service_interaction_log is not None:
        input_["manifest_service_interaction_log"] = (
            manifest_service_interaction_log
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output