New PodeLoggingMethod - mdaneri/Pode GitHub Wiki
Creates a new method for outputting logs (Deprecated).
New-PodeLoggingMethod [-Terminal] [-Batch <Int32>] [-BatchTimeout <Int32>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
New-PodeLoggingMethod [-File] [-Path <String>] -Name <String> [-Batch <Int32>] [-BatchTimeout <Int32>]
[-MaxDays <Int32>] [-MaxSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeLoggingMethod [-EventViewer] [-EventLogName <String>] [-Source <String>] [-EventID <Int32>]
[-Batch <Int32>] [-BatchTimeout <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeLoggingMethod [-Batch <Int32>] [-BatchTimeout <Int32>] [-Custom] -ScriptBlock <ScriptBlock>
[-ArgumentList <Object[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
This function has been deprecated and will be removed in future versions. It creates various logging methods such as Terminal, File, Event Viewer, and Custom logging. Please use the appropriate new functions for each logging method:
- `New-PodeTerminalLoggingMethod` for terminal logging.
- `New-PodeFileLoggingMethod` for file logging.
- `New-PodeEventViewerLoggingMethod` for Event Viewer logging.
- `New-PodeCustomLoggingMethod` for custom logging.
$term_logging = New-PodeLoggingMethod -Terminal
$file_logging = New-PodeLoggingMethod -File -Path ./logs -Name 'requests'
$custom_logging = New-PodeLoggingMethod -Custom -ScriptBlock { /* logic */ }
An array of arguments to supply to the Custom Logging output method's ScriptBlock.
Type: Object[]
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An optional batch size to write log items in bulk (Default: 1)
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
An optional batch timeout, in seconds, to send items off for writing if a log item isn't received (Default: 0)
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
If supplied, will allow you to create a Custom Logging output method.
Type: SwitchParameter
Parameter Sets: Custom
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Optional EventID for the Event Viewer (Default: 0)
Type: Int32
Parameter Sets: EventViewer
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
Optional Log Name for the Event Viewer (Default: Application)
Type: String
Parameter Sets: EventViewer
Aliases:
Required: False
Position: Named
Default value: Application
Accept pipeline input: False
Accept wildcard characters: False
Deprecated. Please use `New-PodeEventViewerLoggingMethod` instead. If supplied, will use the inbuilt Event Viewer logging output method.
Type: SwitchParameter
Parameter Sets: EventViewer
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Deprecated. Please use `New-PodeFileLoggingMethod` instead. If supplied, will use the inbuilt File logging output method.
Type: SwitchParameter
Parameter Sets: File
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The maximum number of days to keep logs, before Pode automatically removes them.
Type: Int32
Parameter Sets: File
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
The maximum size of a log file, before Pode starts writing to a new log file.
Type: Int32
Parameter Sets: File
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
The File Name to prepend new log files using.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The File Path of where to store the logs.
Type: String
Parameter Sets: File
Aliases:
Required: False
Position: Named
Default value: ./logs
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: False
The ScriptBlock that defines how to output a log item.
Type: ScriptBlock
Parameter Sets: Custom
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Optional Source for the Event Viewer (Default: Pode)
Type: String
Parameter Sets: EventViewer
Aliases:
Required: False
Position: Named
Default value: Pode
Accept pipeline input: False
Accept wildcard characters: False
Deprecated. Please use `New-PodeTerminalLoggingMethod` instead. If supplied, will use the inbuilt Terminal logging output method.
Type: SwitchParameter
Parameter Sets: Terminal
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.