你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Enable-AzureWebsiteApplicationDiagnostic
在 Azure 网站上启用应用程序诊断。
注意
本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧式 Azure 资源。 创建新资源时,建议不要使用旧的 PowerShell 模块,因为计划将停用 ASM。 有关详细信息,请参阅 Azure Service Manager 停用。
Az PowerShell 模块是建议用于管理 PowerShell 的 Azure 资源管理器 (ARM) 资源的 PowerShell 模块。
语法
Enable-AzureWebsiteApplicationDiagnostic
[-PassThru]
[-File]
-LogLevel <LogEntryType>
[-Name <String>]
[-Slot <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Enable-AzureWebsiteApplicationDiagnostic
[-PassThru]
[-TableStorage]
-LogLevel <LogEntryType>
[-StorageAccountName <String>]
[-StorageTableName <String>]
[-Name <String>]
[-Slot <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Enable-AzureWebsiteApplicationDiagnostic
[-PassThru]
[-BlobStorage]
-LogLevel <LogEntryType>
[-StorageAccountName <String>]
[-StorageBlobContainerName <String>]
[-Name <String>]
[-Slot <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
说明
本主题介绍 Microsoft Azure PowerShell 模块的 0.8.10 版本中的 cmdlet。
若要获取正在使用的模块版本,请在 Azure PowerShell 控制台中键入 (Get-Module -Name Azure).Version
。
在 Azure 网站上启用应用程序诊断,并允许在文件系统或 Azure 存储上配置日志存储。
示例
示例 1:使用文件系统启用诊断
PS C:\> Enable-AzureWebsiteApplicationDiagnostic -Name MyWebsite -File -LogLevel Verbose
此示例在具有详细级别的文件系统上启用应用程序日志记录。
示例 2:使用 Azure 存储 启用日志记录
PS C:\> Enable-AzureWebsiteApplicationDiagnostic -Name MyWebsite -Storage -LogLevel Information -StorageAccountName myaccount
此示例使用名为 myaccount 的存储帐户启用应用程序日志记录,日志记录级别设置为“信息”。
参数
-BlobStorage
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-File
指定要使用文件系统来存储日志文件。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-LogLevel
要存储的日志级别。 此参数的可接受值为:
- 错误
- 警告
- 信息
- 详细
类型: | LogEntryType |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Name
指定 Azure 网站的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-PassThru
返回一个代表你所处理的项目的对象。 默认情况下,此 cmdlet 将不产生任何输出。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Profile
指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。
类型: | AzureSMProfile |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Slot
指定槽的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-StorageAccountName
用于存储日志的存储帐户。 如果未指定,则使用 CurrentStorageAccount。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageBlobContainerName
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageTableName
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TableStorage
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |