Avatar of loneieagle2
loneieagle2
Flag for United States of America asked on

How do I manage logs in the LOGGING folder of Exchange Server 2016

What is the best way to manage the logs files in Exchange Server 2016? I'm not referring to the log files in the Mailbox folder which are managed when the mailbox is backed up.
I mean the LOGGING folder which has 80 folders with various types of logs.
So specifically, is there settings in Exchange to limit the size or dates of these?
Can all of the logs in these folders be purged after a set time period, which I can do with a script? Or do some of them need to be kept indefinitely?
I have found a little about this that says certain of the folders inside the LOGGING folder can have the contents deleted, but I'm wondering about doing all of them.

Thanks for any guidance on this.  
Exchange

Avatar of undefined
Last Comment
M A

8/22/2022 - Mon
M A

loneieagle2

ASKER
Thanks MAS, but that does not answer my question.
The automation is for IIS log files which we already maintain with a script. The second part of your answer is for the Database Logs which get purged by our Exchange aware backup.

I am asking about the log files in C:\Program Files\Microsoft\Exchange Server\V15\Logging. 
M A

You can use a script to delete the files older than x days
ForFiles /p "C:\Program Files\Microsoft\Exchange Server\V15\Logging" /s /d -30 /c "cmd /c del @file"

Open in new window

You can automate this by Task scheduler
https://winaero.com/delete-files-older-x-days/ 

Please check this as well
https://social.technet.microsoft.com/wiki/contents/articles/31117.exchange-logging-clearing-log-files
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
M A

loneieagle2

ASKER
MAS
So it looks like the answer to my question is that I can delete all the old log files from the LOGGING folder without breaking anything.
Lee W, MVP

As a general rule, DON'T DELETE (at least at first).  MOVE.  You can always move back.  Move and if in 3 months no unusual behavior is observed, you know you can delete.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
M A

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.