• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

Exchange 2013 and IIS Logs filling up Hard disk space

So recently we ran into a problem on our exchange environment. The "logging" folder in the exchange server is filling up about 30GB of space, and the same goes for the IIS logs folder also about 30GB and this caused our exchange server to stop receiving mail. This appears to have started since the latest Exchange 2013 CU that we applied.

Is there anyway to cut down or have it clear out logs after they are X days old with out messing up exchange?
0
Crossroads305
Asked:
Crossroads305
5 Solutions
 
IvanSystem EngineerCommented:
Hi,

you can configure task, to delete logs older then XX days. I am using this method.
Save as VBScript, and run as task.

Change log folder path (if you are not using default), and change iMaxAge (to delete log older then 30 days, in this case).

sLogFolder = "c:\inetpub\logs\LogFiles"
iMaxAge = 30   'in days
Set objFSO = CreateObject("Scripting.FileSystemObject")
set colFolder = objFSO.GetFolder(sLogFolder)
For Each colSubfolder in colFolder.SubFolders
        Set objFolder = objFSO.GetFolder(colSubfolder.Path)
        Set colFiles = objFolder.Files
        For Each objFile in colFiles
                iFileAge = now-objFile.DateCreated
                if iFileAge > (iMaxAge+1)  then
                        objFSO.deletefile objFile, True
                end if
        Next
Next

Helpful link: http://www.iis.net/learn/manage/provisioning-and-managing-iis/managing-iis-log-file-storage

Regards,
Ivan.
0
 
Gaurav SinghSolution ArchitectCommented:
you can schedule  the script to clear the logs . For IIS Refer

https://www.iis.net/learn/manage/provisioning-and-managing-iis/managing-iis-log-file-storage

About exchange can you please let us know what folder it is?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Todd NelsonSystems EngineerCommented:
Most logs in Exchange have a lifetime between 7 to 30 days.  This is common beginning with Exchange 2013, not with a specific CU.  Is it possible that coincidentally you had an increase in traffic or something else is or has recently occurred to that server>

If you have available space on another disk, you can move the logs from the default of C (if that's where they reside currently) ... http://social.technet.microsoft.com/wiki/contents/articles/22479.move-logging-in-exchange-2013-via-powershell.aspx

If you are just looking to remove log files, refer to this reference article ... https://oddytee.wordpress.com/2014/09/11/references-remove-exchange-2013-diagnostic-log-files/
0
 
Simon Butler (Sembee)ConsultantCommented:
IIS logs just build and logging is enabled by default.
I recently cleared over 300gb of logs from a server - they hadn't been deleted since 2011.

If you don't want logging on IIS, then disable it within IIS manager.

The installation of the cumulative update would have nothing to do with the increase in logs.
0
 
Crossroads305Author Commented:
Thanks for all the help, Maybe it's just a coincident. a bunch of people got iPhones as of late here as well and I saw some articles talking about them causing excessive logging problems. I'll put some of these solutions in place and see if it helps.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now