Open in the explorer

Control Event Log behavior when the log file reaches its maximum size

Contrôler le comportement du journal des événements lorsque le fichier journal atteint sa taille maximale.

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Event Log Service › Application FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Service Journal des événements › Application
Supported on
At least Windows Vista FR: Au minimum Windows Vista
ADMX file
EventLog.admx
Internal name
EventLog/Channel_Log_Retention_1

Explanation

This policy setting controls Event Log behavior when the log file reaches its maximum size.

If you enable this policy setting and a log file reaches its maximum size, new events are not written to the log and are lost.

If you disable or do not configure this policy setting and a log file reaches its maximum size, new events overwrite old events.

Note: Old events may or may not be retained according to the "Backup log automatically when full" policy setting.

French text from Windows 11 26H2

Ce paramètre de stratégie contrôle le comportement du journal des événements lorsque le fichier journal atteint sa taille maximale.

Si vous activez ce paramètre de stratégie et qu’un fichier journal atteint sa taille maximale, les nouveaux événements ne sont pas écrits dans le journal et sont perdus.

Si vous désactivez ce paramètre de stratégie ou ne le configurez pas et qu’un fichier journal atteint sa taille maximale, les nouveaux événements remplacent les anciens.

Remarque : la conservation ou non des anciens événements dépend du paramètre de stratégie « Sauvegarder le journal automatiquement lorsqu’il est plein ».

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\Application
Value name
Retention
StateValue written
EnabledREG_SZ = 1
DisabledREG_SZ = 0

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: EventLog/Channel_Log_Retention_1
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Application'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'Retention' -Value '1' -Type String

Disable

# Disable: EventLog/Channel_Log_Retention_1
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Application'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'Retention' -Value '0' -Type String

Revert to "Not configured"

# Revert to "Not configured": EventLog/Channel_Log_Retention_1
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\Application'
Remove-ItemProperty -Path $k -Name 'Retention' -ErrorAction SilentlyContinue

Availability