Schlagwort-Archive: free up

log rollover for Exchange 2013 server

use forfiles (or something like that) for log rollover of Exchange Server to free up disk space – implement it for following folders

C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\ETLTraces
C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\Logs
C:\Program Files\Microsoft\Exchange Server\V15\Logging
C:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\PerformanceLogsToBeProcessed
C:\Program Files\Microsoft\Exchange Server\V15\Logging\Monitoring\Monitoring\MSExchangeHMWorker\ActiveMonitoringTraceLogs
C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp
C:\inetpub\logs

exp: forfiles /p C:\inetpub\logs /m *.log /s /d -10 /c „cmd /c DEL @path“

alternativ with Powershell:

Function Remove-ToolsLog($olderThenDays){

Set-ToolsLogAddLine -LogTXT „Remove old log files“ -Foregroundcolor „green“

$logPath = Split-Path $Script:LogFilePath -Parent

Get-ChildItem -path $logPath | Where-Object { !$_.PSIsContainer -and $_.Extension -eq „.log“ -and $_.CreationTime -lt (Get-Date).AddDays($olderThenDays) } | Remove-Item -Force

}

Limit Diagnostic-Service logs

Edit the Microsoft.Exchange.Diagnostics.Service.exe.config file in the bin folder by adding the following line in the appSettings area:

<add key=“MaxDailyPerformancelogDirectorySize“ value=“1024″/>
or lower <add key=“MaxDailyPerformancelogDirectorySize“ value=“512″/>

The value is the maximum space consumed for daily performance logs, in megabytes.

Then restart the MSExchangeDiagnostics service for the change to take effect.