    # File lib/fog/aws/requests/storage/put_bucket_logging.rb, line 27
            def put_bucket_logging(bucket_name, logging_status)
              if logging_status['LoggingEnabled'].empty?
                data =
    "<BucketLoggingStatus xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\" />\n"
              else
                data =
    "<BucketLoggingStatus xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\">\n<LoggingEnabled>\n<TargetBucket>\#{logging_status['LoggingEnabled']['TargetBucket']}</TargetBucket>\n<TargetPrefix>\#{logging_status['LoggingEnabled']['TargetBucket']}</TargetPrefix>\n<TargetGrants>\n"

                acl['AccessControlList'].each do |grant|
                  data << "      <Grant>"
                  type = case grant['Grantee'].keys.sort
                  when ['DisplayName', 'ID']
                    'CanonicalUser'
                  when ['EmailAddress']
                    'AmazonCustomerByEmail'
                  when ['URI']
                    'Group'
                  end
                  data << "        <Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"#{type}\">"
                  for key, value in grant['Grantee']
                    data << "          <#{key}>#{value}</#{key}>"
                  end
                  data << "        </Grantee>"
                  data << "        <Permission>#{grant['Permission']}</Permission>"
                  data << "      </Grant>"
                end

                data <<
    "</TargetGrants>\n</LoggingEnabled>\n</BucketLoggingStatus>\n"
              end

              request({
                :body     => data,
                :expects  => 200,
                :headers  => {},
                :host     => "#{bucket_name}.#{@host}",
                :method   => 'PUT',
                :query    => {'logging' => nil}
              })
            end