共用方式為


Set-AzApiManagementLogger

修改 API 管理記錄器。

語法

Set-AzApiManagementLogger
   -Context <PsApiManagementContext>
   -LoggerId <String>
   [-Name <String>]
   [-ConnectionString <String>]
   [-Description <String>]
   [-IsBuffered]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzApiManagementLogger
   -Context <PsApiManagementContext>
   -LoggerId <String>
   [-InstrumentationKey <String>]
   [-Description <String>]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Set-AzApiManagementLogger Cmdlet 會修改 Azure API 管理 Logger的設定。

範例

範例 1:修改 EventHub 記錄器

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Set-AzApiManagementLogger -Context $apimContext -LoggerId "Logger123" -Name "ContosoSdkEventHub" -ConnectionString "Endpoint=sb://ContosoSdkEventHubs.servicebus.windows.net/;SharedAccessKeyName=SendKey;SharedAccessKey=<key>" -Description "updated SDK event hub logger" -PassThru

此命令會修改標識碼為Logger123的記錄器。

範例 2

修改 API 管理記錄器。 ( 自動產生 )

Set-AzApiManagementLogger -Confirm -Context <PsApiManagementContext> -InstrumentationKey <String> -LoggerId 'Logger123'

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ConnectionString

指定包含傳送原則許可權的 Azure 事件中樞連接字串。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Context

指定 PsApiManagementContext 物件。

類型:PsApiManagementContext
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Description

指定描述。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-InstrumentationKey

Application Insights 的檢測密鑰。 這個參數是選擇性的。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-IsBuffered

指定記錄器中的記錄會在發佈之前緩衝處理。 當記錄經過緩衝處理時,會每隔 15 秒傳送至事件中樞,或每當緩衝區收到 256 KB 的訊息時。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-LoggerId

指定要更新的記錄器識別碼。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Name

從 Azure 傳統入口網站指定事件中樞的實體名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-PassThru

指出此 Cmdlet 會傳回此 Cmdlet 修改的 PsApiManagementLogger

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

PsApiManagementContext

String

SwitchParameter

輸出

PsApiManagementLogger