/// <summary>
 /// Creates a new enumerable which will iterate over the responses received from the ListLogs operation. This enumerable
 /// will fetch more data from the server as needed.
 /// </summary>
 /// <param name="request">The request object containing the details to send</param>
 /// <param name="retryConfiguration">The configuration for retrying, may be null</param>
 /// <param name="cancellationToken">The cancellation token object</param>
 /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns>
 public IEnumerable <ListLogsResponse> ListLogsResponseEnumerator(ListLogsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
 {
     return(new Common.Utils.ResponseEnumerable <ListLogsRequest, ListLogsResponse>(
                response => response.OpcNextPage,
                input =>
     {
         if (!string.IsNullOrEmpty(input))
         {
             request.Page = input;
         }
         return request;
     },
                request => client.ListLogs(request, retryConfiguration, cancellationToken)
                ));
 }
Пример #2
0
        private static async Task ListLogs(LoggingManagementClient client, string logGroup)
        {
            ListLogsRequest listLogsRequest = new ListLogsRequest
            {
                LogGroupId = logGroup
            };
            // Pass the log group whose logs you want to list
            ListLogsResponse response = await client.ListLogs(listLogsRequest);

            logger.Info("List Logs");
            logger.Info("=============");
            foreach (LogSummary logSummary in response.Items)
            {
                logger.Info($"Log Display Name: {logSummary.DisplayName}, Log Type:{logSummary.LogType}");
            }
        }