Skip to content

Commit 80bab8c

Browse files
committed
Fixes size of Icinga for Windows eventlog, by setting it to 20 MiB
1 parent 9a84e9d commit 80bab8c

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

doc/100-General/10-Changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ documentation before upgrading to a new release.
77

88
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
99

10+
## 1.13.0 (tbd)
11+
12+
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/32)
13+
14+
## 1.12.1 (tbd)
15+
16+
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/33)
17+
18+
### Bugfixes
19+
20+
* [#707](https://github.com/Icinga/icinga-powershell-framework/pull/707) Fixes size of the `Icinga for Windows` eventlog by setting it to `20MiB`, allowing to store more events before they are overwritten
21+
1022
## 1.12.0 (2024-03-26)
1123

1224
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/28)

lib/core/framework/Invoke-IcingaForWindowsMigration.psm1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,14 @@ function Invoke-IcingaForWindowsMigration()
100100

101101
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.12.0');
102102
}
103+
104+
if (Test-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.12.1')) {
105+
Write-IcingaConsoleNotice 'Applying pending migrations required for Icinga for Windows v1.12.1';
106+
107+
# Fixes the size of the Icinga for Windows Eventlog, allowing more logs to be collected
108+
# before older ones are faded out
109+
Register-IcingaEventLog;
110+
111+
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.12.1');
112+
}
103113
}

lib/core/logging/Register-IcingaEventLog.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ function Register-IcingaEventLog()
1313

1414
New-EventLog -LogName 'Icinga for Windows' -Source $LogName -ErrorAction SilentlyContinue;
1515
}
16+
17+
$IfWEventLog = Get-WinEvent -ListLog 'Icinga for Windows';
18+
# Set the size to 20MiB
19+
$IfWEventLog.MaximumSizeInBytes = 20971520;
20+
$IfWEventLog.SaveChanges();
1621
}

0 commit comments

Comments
 (0)