New-PodeLogFileMethod
SYNOPSIS
Create a new File Log Method.
SYNTAX
New-PodeLogFileMethod [[-Id] <String>] [-Name] <String> [[-Path] <String>] [[-MaxDays] <Int32>]
[[-MaxSize] <Int32>] [[-BatchInfo] <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Creates a new File Log Method for outputting log items to files. Can be used with Enable-PodeLogRequestType, Enable-PodeLogErrorType, or Add-PodeLogType.
EXAMPLES
EXAMPLE 1
$methodId = New-PodeLogFileMethod -Name 'requests'
EXAMPLE 2
$batchInfo = New-PodeLogBatchInfo -Size 10 -Timeout 10
$methodId = New-PodeLogFileMethod -Name 'requests' -BatchInfo $batchInfo -MaxDays 7 -MaxSize 10MB
PARAMETERS
-BatchInfo
An optional hashtable containing batch configuration for writing log items in bulk. Should be created using New-PodeLogBatchInfo.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Id
An optional ID to assign to the Log Method. If not supplied, a random ID will be generated.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MaxDays
The maximum number of days to keep logs, before Pode automatically removes them.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-MaxSize
The maximum size of a log file, before Pode starts writing to a new log file.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-Name
The File Name to prepend new log files using.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Path
The File Path of where to store the logs.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: ./logs
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ 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
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.