你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ContainerGroupResource.GetContainerLogsAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取指定资源组和容器组中指定容器实例的日志。
- 请求路径/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs
- 操作IdContainers_ListLogs
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ContainerInstance.Models.ContainerLogs>> GetContainerLogsAsync (string containerName, int? tail = default, bool? timestamps = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetContainerLogsAsync : string * Nullable<int> * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ContainerInstance.Models.ContainerLogs>>
override this.GetContainerLogsAsync : string * Nullable<int> * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ContainerInstance.Models.ContainerLogs>>
Public Overridable Function GetContainerLogsAsync (containerName As String, Optional tail As Nullable(Of Integer) = Nothing, Optional timestamps As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ContainerLogs))
参数
- containerName
- String
容器实例的名称。
- cancellationToken
- CancellationToken
要使用的取消标记。
返回
例外
containerName
是一个空字符串,预期为非空。
containerName
为 null。