Exchange 2013 Activesync IIS log file size

We are an Microsoft Exchange environment .  We use Active sync to sync our 80 devices (iphones and Samsung galaxies) with exchange, Periodically ( 2 or 3 times a year ) I would delete/cleanup old  c$\inetpub\logs\LogFiles\W3SVC1 and also the W3SVC2 and W3SVC3 folders. They would have a tremendous amount of files and each file could be 30 MB or so.
Now in those folders the files are over 300 MB each and I have to cleanup these folders monthly.
I understand these are log files,  Is my exchange server a problem ? or are some of the smartphones having problems ?
What can I look at to see why these files have now grown 10 times what they were.

Any info is appreciated
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jackie Man IT Manager
Top Expert 2010
Yes, you can delete the log files that are in that directory.  There will be no net effect on your server.

What you can do is reconfigure the logging feature in IIS to rotate the logs out on a regular basis so that you don't wind up with excessively large log files.  You can also reconfig the logging feature to save the log file somewhere else other than the boot partition (c: drive), this helps avoid the situation where the log files clog up the c: drive and causes operational issues with the OS.

If you reconfigure IIS' logging feature you do not need to restart IIS.


300mb is not a large log file. Unless you have outstanding tickets from users and you need to do troubleshooting, you can delete the log file.
Sr. Systems Administrator
We use a script that deletes log files older than 60 days. Its a powershell script and you can run it as a scheduled task every day

$limit = (Get-Date).AddDays(-60)
$path1 = "C:\inetpub\logs\logfiles\w3svc1"
$path2 = "C:\inetpub\logs\logfiles\w3svc2"

# Delete files older than the $limit.
Get-ChildItem -Path $path1 -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
Get-ChildItem -Path $path2 -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force

To change the amount logs you keep, just change the AddDays part. The script assumes you have a multi-role server. If not, you only use the line you need.


Thank you for the script,  it will be very helpful, also rotating the logs as Jackie Man noted may be a good idea or even moving to a separate/different location.
I think my underlying question should have been.  " Why are my logs so much larger now, than they were at the beginning of the year ?"
My number of active sync users has not changed
I am wondering if there is something in the log I should look at to find out if I am having some type of problem.
I hope that makes sense.
Jeff GloverSr. Systems Administrator

If you mean logs getting bigger each day, it can be for many reasons. You could have more people with mobile devices. Also, the logs cover more than just ActiveSync. It also covers OWA and any other web related stuff. They are basically IIS 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