We help IT Professionals succeed at work.

Exchange 2016 logging folder Huge

P V
P V asked
on
2,574 Views
1 Endorsement
Last Modified: 2018-12-30
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



Exchange-Loggig.JPG
Comment
Watch Question

MASEE Solution Guide - Technical Dept Head
CERTIFIED EXPERT
Most Valuable Expert 2017

Commented:
-->Is there anyway to cleanup- automatically & is is safe to cleanup
Do not clean manually. There are scrips available for cleaning up.
Solutions Architect
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Here's a good wiki article about Exchange logs: https://social.technet.microsoft.com/wiki/contents/articles/31117.exchange-201320162019-logging-clear-out-the-log-files.aspx

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

https://community.spiceworks.com/how_to/153965-clear-exchange-2013-2016-log-files
timgreen7077Exchange Engineer
CERTIFIED EXPERT
Distinguished Expert 2018

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

https://gallery.technet.microsoft.com/office/Clear-Exchange-2013-Log-71abba44

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
CERTIFIED EXPERT

Author

Commented:
Thanks guys for you comments,

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

Commented:
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
CERTIFIED EXPERT

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

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions