New PodeEventViewerLoggingMethod - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: LoggingMethod schema: 2.0.0
Creates a new Event Viewer logging method in Pode.
New-PodeEventViewerLoggingMethod [-EventLogName <String>] [-Source <String>] [-EventID <Int32>]
[-FailureAction <String>] [-DataFormat <String>] [-AsUTC] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
New-PodeEventViewerLoggingMethod [-EventLogName <String>] [-Source <String>] [-EventID <Int32>]
[-FailureAction <String>] [-ISO8601] [-AsUTC] [-ProgressAction <ActionPreference>] [<CommonParameters>]
This function sets up a logging method that outputs log messages to the Windows Event Viewer. It allows configuring the log name, source, and event ID, along with date formatting options like custom formats or ISO 8601.
$logMethod = New-PodeEventViewerLoggingMethod -EventLogName 'Application' -Source 'PodeApp'
Creates a new Event Viewer logging method that writes to the 'Application' log with the source 'PodeApp'.
$logMethod = New-PodeEventViewerLoggingMethod -Source 'MyApp' -EventID 1001 -ISO8601
Creates a new Event Viewer logging method with ISO 8601 date format, writing to the 'MyApp' source and using event ID 1001.
If set, logs the time in UTC instead of local time.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe custom date format for log entries. Mutually exclusive with ISO8601.
Type: String
Parameter Sets: DataFormat
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe ID of the event to log. Defaults to 0.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the event log to write to. Defaults to 'Application'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Application
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the action to take if logging fails. Options are: Ignore, Report, Halt (Default: Ignore).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Ignore
Accept pipeline input: False
Accept wildcard characters: FalseIf set, uses the ISO 8601 date format for log entries. Mutually exclusive with DataFormat.
Type: SwitchParameter
Parameter Sets: ISO8601
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe source of the log entries. Defaults to 'Pode'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Pode
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.