Skip to content

Commit

Permalink
Squashed changes from PR Badgerati#1507
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaneri committed Mar 3, 2025
1 parent ba8309b commit 113fc0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Private/Logging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ function Get-PodeLoggingFileMethod {
$item.ToString() | Out-File -FilePath $path -Encoding utf8 -Append -Force

# if set, remove log files beyond days set (ensure this is only run once a day)
if (($options.MaxDays -gt 0) -and ($options.NextClearDown -lt [DateTime]::Now.Date)) {
if (($options.MaxDays -gt 0) -and ($options.NextClearDown -le [DateTime]::Now.Date)) {
$date = [DateTime]::Now.Date.AddDays(-$options.MaxDays)

$null = Get-ChildItem -Path $options.Path -Filter '*.log' -Force |
$null = Get-ChildItem -Path $options.Path -Filter "$($options.Name)_*.log" -Force |
Where-Object { $_.CreationTime -lt $date } |
Remove-Item -Force

Expand Down

0 comments on commit 113fc0d

Please sign in to comment.