:doc:`Lightsail <../../lightsail>` / Client / get_relational_database_log_events

**********************************
get_relational_database_log_events
**********************************



.. py:method:: Lightsail.Client.get_relational_database_log_events(**kwargs)

  

  Returns a list of log events for a database in Amazon Lightsail.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents>`_  


  **Request Syntax**
  ::

    response = client.get_relational_database_log_events(
        relationalDatabaseName='string',
        logStreamName='string',
        startTime=datetime(2015, 1, 1),
        endTime=datetime(2015, 1, 1),
        startFromHead=True|False,
        pageToken='string'
    )
    
  :type relationalDatabaseName: string
  :param relationalDatabaseName: **[REQUIRED]** 

    The name of your database for which to get log events.

    

  
  :type logStreamName: string
  :param logStreamName: **[REQUIRED]** 

    The name of the log stream.

     

    Use the ``get relational database log streams`` operation to get a list of available log streams.

    

  
  :type startTime: datetime
  :param startTime: 

    The start of the time interval from which to get log events.

     

    Constraints:

     

    
    * Specified in Coordinated Universal Time (UTC).
     
    * Specified in the Unix time format. For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input ``1538424000`` as the start time.
    

    

  
  :type endTime: datetime
  :param endTime: 

    The end of the time interval from which to get log events.

     

    Constraints:

     

    
    * Specified in Coordinated Universal Time (UTC).
     
    * Specified in the Unix time format. For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input ``1538424000`` as the end time.
    

    

  
  :type startFromHead: boolean
  :param startFromHead: 

    Parameter to specify if the log should start from head or tail. If ``true`` is specified, the log event starts from the head of the log. If ``false`` is specified, the log event starts from the tail of the log.

     

    .. note::

      

      For PostgreSQL, the default value of ``false`` is the only option available.

      

    

  
  :type pageToken: string
  :param pageToken: 

    The token to advance to the next or previous page of results from your request.

     

    To get a page token, perform an initial ``GetRelationalDatabaseLogEvents`` request. If your results are paginated, the response will return a next forward token and/or next backward token that you can specify as the page token in a subsequent request.

    

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

    
    ::

      {
          'resourceLogEvents': [
              {
                  'createdAt': datetime(2015, 1, 1),
                  'message': 'string'
              },
          ],
          'nextBackwardToken': 'string',
          'nextForwardToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **resourceLogEvents** *(list) --* 

        An object describing the result of your get relational database log events request.

        
        

        - *(dict) --* 

          Describes a database log event.

          
          

          - **createdAt** *(datetime) --* 

            The timestamp when the database log event was created.

            
          

          - **message** *(string) --* 

            The message of the database log event.

            
      
    
      

      - **nextBackwardToken** *(string) --* 

        A token used for advancing to the previous page of results from your get relational database log events request.

        
      

      - **nextForwardToken** *(string) --* 

        A token used for advancing to the next page of results from your get relational database log events request.

        
  
  **Exceptions**
  
  *   :py:class:`Lightsail.Client.exceptions.ServiceException`

  
  *   :py:class:`Lightsail.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Lightsail.Client.exceptions.NotFoundException`

  
  *   :py:class:`Lightsail.Client.exceptions.OperationFailureException`

  
  *   :py:class:`Lightsail.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Lightsail.Client.exceptions.AccountSetupInProgressException`

  
  *   :py:class:`Lightsail.Client.exceptions.RegionSetupInProgressException`

  
  *   :py:class:`Lightsail.Client.exceptions.UnauthenticatedException`

  