:doc:`CloudWatchLogs <../../logs>` / Client / tag_log_group

*************
tag_log_group
*************



.. py:method:: CloudWatchLogs.Client.tag_log_group(**kwargs)

  

  .. warning::

    

    The TagLogGroup operation is on the path to deprecation. We recommend that you use `TagResource <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagResource.html>`__ instead.

     

   

  Adds or updates the specified tags for the specified log group.

   

  To list the tags for a log group, use `ListTagsForResource <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsForResource.html>`__. To remove tags, use `UntagResource <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UntagResource.html>`__.

   

  For more information about tags, see `Tag Log Groups in Amazon CloudWatch Logs <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#log-group-tagging>`__ in the *Amazon CloudWatch Logs User Guide*.

   

  CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the ``aws:Resource/key-name`` or ``aws:TagKeys`` condition keys. For more information about using tags to control access, see `Controlling access to Amazon Web Services resources using tags <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html>`__.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroup>`_  


  **Request Syntax**
  ::

    response = client.tag_log_group(
        logGroupName='string',
        tags={
            'string': 'string'
        }
    )
    
  :type logGroupName: string
  :param logGroupName: **[REQUIRED]** 

    The name of the log group.

    

  
  :type tags: dict
  :param tags: **[REQUIRED]** 

    The key-value pairs to use for the tags.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  
  :returns: None
  **Exceptions**
  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.InvalidParameterException`

  