powershell - 使用 PowerShell 在 Web 应用程序中启用应用程序日志记录

标签 powershell azure automation azure-powershell azure-web-app-service

我可以使用 PowerShell 在 Web 应用程序中启用应用程序日志记录吗?

目前,我运行这些命令来启用其他设置,但我不知道如何启用应用程序日志(文件系统)设置。

Set-AzureRmWebApp -ResourceGroupName "habdol" -DetailedErrorLoggingEnabled $true -HttpLoggingEnabled $true -RequestTracingEnabled $true 

最佳答案

使用Enable-AzureWebsiteapplicationDiagnostic cmdlet。例如,要将应用程序日志记录(文件系统)设置为“警告”级别,请执行以下操作:

Enable-AzureWebsiteApplicationDiagnostic -Name $webAppName -File -LogLevel Warning

请注意,没有用于此目的的“AzureRM”等效 cmdlet。至少我没见过。

此外,请记住,当您启用应用程序日志记录到文件系统时,它将在 12 小时后自动禁用。

关于powershell - 使用 PowerShell 在 Web 应用程序中启用应用程序日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38339176/

相关文章:

.net - 防止 ArrayList.Add() 返回索引

azure - "hostname"从 Composer 发布 Azure Bot

java - 有些Ashot策略有 "simulator"字样,它们有什么区别?

javascript - 我可以通过 URL 向 JavaScript 发送命令吗?

azure - 如何在没有对应用程序网关进行身份验证的情况下从elasticsearch给出200响应?

ubuntu - Ansible - rsyslog 安装和配置

powershell - 批处理文件未正确读取标志

git - 在没有bash的情况下将git连接到windows 7上的github

powershell - Powershell复制文件或获取内容而不锁定它

azure - Visual Studio Online CI 可以构建到自定义主机吗?