Exchange 2016 logging folder Huge

P V used Ask the Experts™
HI guys

I have an exchange server 2016 & its logging folder  is getting filled up very quickly & huge in space. Is there anyway to cleanup- automatically & is is safe to cleanup

Logging path

c:\program files\microsoft\exchange server\V15\Logging

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
MASEE Solution Guide - Technical Dept Head
Most Valuable Expert 2017

-->Is there anyway to cleanup- automatically & is is safe to cleanup
Do not clean manually. There are scrips available for cleaning up.
Here's a good wiki article about Exchange logs:

Once try this script:

gci 'C:\Program Files\Microsoft\Exchange Server\V15\Logging', 'C:\inetpub\logs' -Directory | gci -Include '*.log','*.blg' -Recurse | ? LastWriteTime -lt (Get-Date).AddDays(-7) | Remove-Item
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

timgreen7077Exchange Engineer
Distinguished Expert 2018

See the link for the below script and you can run it via the powershell.

You can actually delete those files manually (not the folder), and it will not cause a problem, run the script will save you a ton of time.
Download the script and right click and select run with powershell, and thats it, you will watch as it deletes all those files. It can take a while if there is are alot of files so be patient it working.
P VStorage & Virtualization  Consultant


Thanks guys for you comments,

 but is there a way to disable this logging... ?
timgreen7077Exchange Engineer
Distinguished Expert 2018

There is always a way but it will take modifying the config files on each folder and the next time you run a CU update on exchange it will be enabled again. Not worth the trouble. Just run that script and you will be good. You can set the script to run as a scheduled task but that i definitely the easiest thing to do. Disregard disabling them because they will be needed for troubleshooting if something ever happens.
AkhaterSolutions Architect

Don't disable logging. As per my previous comment schedule the maintenance. You never know when you are going to need the logs

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial