:doc:`CognitoIdentityProvider <../../cognito-idp>` / Client / get_log_delivery_configuration

******************************
get_log_delivery_configuration
******************************



.. py:method:: CognitoIdentityProvider.Client.get_log_delivery_configuration(**kwargs)

  

  Given a user pool ID, returns the logging configuration. User pools can export message-delivery error and threat-protection activity logs to external Amazon Web Services services. For more information, see `Exporting user pool logs <https://docs.aws.amazon.com/cognito/latest/developerguide/exporting-quotas-and-usage.html>`__.

   

  .. note::

    

    Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

     

    **Learn more**

     

    
    * `Signing Amazon Web Services API Requests <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html>`__
     
    * `Using the Amazon Cognito user pools API and user pool endpoints <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html>`__
    

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetLogDeliveryConfiguration>`_  


  **Request Syntax**
  ::

    response = client.get_log_delivery_configuration(
        UserPoolId='string'
    )
    
  :type UserPoolId: string
  :param UserPoolId: **[REQUIRED]** 

    The ID of the user pool that has the logging configuration that you want to view.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'LogDeliveryConfiguration': {
              'UserPoolId': 'string',
              'LogConfigurations': [
                  {
                      'LogLevel': 'ERROR'|'INFO',
                      'EventSource': 'userNotification'|'userAuthEvents',
                      'CloudWatchLogsConfiguration': {
                          'LogGroupArn': 'string'
                      },
                      'S3Configuration': {
                          'BucketArn': 'string'
                      },
                      'FirehoseConfiguration': {
                          'StreamArn': 'string'
                      }
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **LogDeliveryConfiguration** *(dict) --* 

        The logging configuration of the requested user pool. Includes types of logs configured and their destinations.

        
        

        - **UserPoolId** *(string) --* 

          The ID of the user pool where you configured logging.

          
        

        - **LogConfigurations** *(list) --* 

          A logging destination of a user pool. User pools can have multiple logging destinations for message-delivery and user-activity logs.

          
          

          - *(dict) --* 

            The configuration of user event logs to an external Amazon Web Services service like Amazon Data Firehose, Amazon S3, or Amazon CloudWatch Logs.

            
            

            - **LogLevel** *(string) --* 

              The ``errorlevel`` selection of logs that a user pool sends for detailed activity logging. To send ``userNotification`` activity with `information about message delivery <https://docs.aws.amazon.com/cognito/latest/developerguide/exporting-quotas-and-usage.html>`__, choose ``ERROR`` with ``CloudWatchLogsConfiguration``. To send ``userAuthEvents`` activity with user logs from threat protection with the Plus feature plan, choose ``INFO`` with one of ``CloudWatchLogsConfiguration``, ``FirehoseConfiguration``, or ``S3Configuration``.

              
            

            - **EventSource** *(string) --* 

              The source of events that your user pool sends for logging. To send error-level logs about user notification activity, set to ``userNotification``. To send info-level logs about threat-protection user activity in user pools with the Plus feature plan, set to ``userAuthEvents``.

              
            

            - **CloudWatchLogsConfiguration** *(dict) --* 

              The CloudWatch log group destination of user pool detailed activity logs, or of user activity log export with threat protection.

              
              

              - **LogGroupArn** *(string) --* 

                The Amazon Resource Name (arn) of a CloudWatch Logs log group where your user pool sends logs. The log group must not be encrypted with Key Management Service and must be in the same Amazon Web Services account as your user pool.

                 

                To send logs to log groups with a resource policy of a size greater than 5120 characters, configure a log group with a path that starts with ``/aws/vendedlogs``. For more information, see `Enabling logging from certain Amazon Web Services services <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html>`__.

                
          
            

            - **S3Configuration** *(dict) --* 

              The Amazon S3 bucket destination of user activity log export with threat protection. To activate this setting, your user pool must be on the `Plus tier <https://docs.aws.amazon.com/cognito/latest/developerguide/feature-plans-features-plus.html>`__.

              
              

              - **BucketArn** *(string) --* 

                The ARN of an Amazon S3 bucket that's the destination for threat protection log export.

                
          
            

            - **FirehoseConfiguration** *(dict) --* 

              The Amazon Data Firehose stream destination of user activity log export with threat protection. To activate this setting, your user pool must be on the `Plus tier <https://docs.aws.amazon.com/cognito/latest/developerguide/feature-plans-features-plus.html>`__.

              
              

              - **StreamArn** *(string) --* 

                The ARN of an Amazon Data Firehose stream that's the destination for threat protection log export.

                
          
        
      
    
  
  **Exceptions**
  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InternalErrorException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.NotAuthorizedException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException`

  