Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzApiManagementLogger
- Module:
- Az.ApiManagement Module
Creates an API Management Logger.
Syntax
EventHubLoggerSet (Default)
New-AzApiManagementLogger
-Context <PsApiManagementContext>
-Name <String>
-ConnectionString <String>
[-LoggerId <String>]
[-Description <String>]
[-IsBuffered <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ApplicationInsightsLoggerSet
New-AzApiManagementLogger
-Context <PsApiManagementContext>
-InstrumentationKey <String>
[-LoggerId <String>]
[-Description <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The New-AzApiManagementLogger cmdlet creates an Azure API Management Logger.
Examples
Example 1: Create a logger
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementLogger -Context $apimContext -LoggerId "Logger123" -Name "ContosoSdkEventHub" -ConnectionString "Endpoint=sb://ContosoSdkEventHubs.servicebus.windows.net/;SharedAccessKeyName=SendKey;SharedAccessKey=<key>" -Description "SDK event hub logger"
This command creates a logger named ContosoSdkEventHub by using the specified connection string.
Example 2
Creates an API Management Logger. (autogenerated)
New-AzApiManagementLogger -Context <PsApiManagementContext> -InstrumentationKey <String> -LoggerId 'Logger123'
Parameters
-ConnectionString
Specifies an Azure Event Hubs connection string that starts with the following:
Endpoint=endpoint and key from Azure classic portal
The Key with Send Rights in the connection string must be configured.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Context
Specifies a PsApiManagementContext object.
Parameter properties
| Type: | PsApiManagementContext |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-Description
Specifies a description.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InstrumentationKey
Instrumentation Key of the application Insights. This parameter is optional.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-IsBuffered
Specifies whether the records in the logger are buffered before publishing. The default value is $True. When records are buffered, they are sent to Event Hubs every 15 seconds, or whenever the buffer receives 256 KB of messages.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-LoggerId
Specifies an ID for the logger. If you do not specify an ID, this cmdlet generates one.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
Specifies the entity name of an event hub from Azure classic portal.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
PsApiManagementContext
String
Nullable<T>
Outputs
PsApiManagementLogger
Related Links
Azure PowerShell
Feedback
Was this page helpful?
