设为首页 收藏本站
查看: 790|回复: 0

[经验分享] EXCHANGE 13/16清理IIS LOGS日志文件(含脚本)

[复制链接]

尚未签到

发表于 2018-7-4 11:04:55 | 显示全部楼层 |阅读模式
  EXCHANGE 2013\2016清除IIS LOGS 日志文件。
  在完成安装后,即使EXCHANGE不安装在系统盘也会在系统盘下生成IIS日志文件,使用RPC overHTTP或Mapi overHTTP协议,所以都是IIS提供各种服务,这些日志是每次用户连接到exchange时的日志,可以用来诊断连接问题或者安全问题。
  默认位置:C:\inetpub\logs\LogFiles(默认C为系统盘的话)
  可以在IIS管理器里面更改存储目录为别的盘符,并直接删掉这些目录文件,也可使用脚本进行清理。
  IIS管理器位置截图:
DSC0000.png

Exchange 2013 Logging: Clear outthe log files
Table of Contents

  •   Diagnostic Logs
  •   ETL Files
  •   Registry Change
  •   IIS Log Files
  •   HTTP Proxy Logs
  •   Conclusion
  •   PowerShell Script
  In your Exchange 2013 environment you may be wondering why the space on yourC:\ drive where Exchange is installed is filling up so quickly.
  Thisis due to the amount of logging Exchange 2013 does by default. Microsoft turnedthis on to assist them with more rapid assistance with customers instead ofwaiting for logs.

  FromCU6 for Exchange 2013, .etl files were created. With the current build Exchange2013 creates 50MB files at a time with a maximum of 100 files. For smallerbusinesses this is not>  Theother feature that logs weekly and daily files is the Diagnostic logs (Healthexplorer). This will generate files up to 5GB over a week/month. Some of youmight want that space because you are limited with the current hardware youhave.
  Theother player here is IIS logs. These can generate quite a bit and at 500MB+ alog file you can run out of space rather quickly.
  Lastly,another set of logs that could be filling up is the HTTP Proxy log. Thislog will fill up in most cases when you have issues and will create an hourlyfile from 4MB onward.
  Inthis article we will go through each of the following logs below and explainhow you can maintain them or turn them off:
  themoff:

  •   Diagnostic Logs (Health Manager)
  •   ETL Files
  •   IIS Logs
  •   HTTP Proxy Logs
  Lastly,a PowerShell script is available to run a clean up without having to go intoeach folder.
Diagnostic Logs
  HealthManager runs and collects information about the health of the system. If youhave ample space this is fine but if you have an 80GB C:\ drive your drive isgoing to fill up in less than a few days. If you need to disable this featureyou can do so as follows:
  Openup Services.msc,
DSC0001.png


  •   Locate     the Microsoft Exchange Health Manager Service.
  •   Double     click the service and change the startup to disabled.
  •   Stop     the service if it is running.
DSC0002.png


  •   The     next service to locate is the Microsoft Exchange Diagnostics Service.
  •   Follow     the same steps as above to stop and disable the service.
  Thenext thing to stop/disable is the task that runs. Open up Task Scheduler.
  disable is the taskthat runs. Open up Task Scheduler.
DSC0003.png

  ·   In TaskScheduler, expand Microsoft -> Windows and then click on PLA.
  ·   You will seetwo tasks, first stop them if they running and then disable them.
  The next step is toclear out the logs created by Diagnostics. Open up Explorer.
DSC0004.png

  Navigate toC:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostic.
  ·   In there youwill have two folders, one called DailyPerformanceLogs and theother PerformanceLogsToBeProcessed.
  ·   You candelete all the log files located in these two. The logs to beprocessed will contain 20MB files while the daily logs will be +/- 1GB.
ETL Files

  Thesefiles are generated almost every hour and are about 50MB in>  Tolocate these files go to the following location:

  •   C:\Program     Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\ETLTraces
DSC0005.png

  ·   As shownabove, there are a lot of files logged. You can highlight all of them anddelete them without a problem. This will free up a few GB.
  Within theDiagnostics folder there is another folder that is logging. Here is thelocation:
  ·   C:\ProgramFiles\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\Logs

  •   As you can see above, a lot of log files are here and youcan delete these text files.
Registry Change
  Youcan change the default value of 100 files to a number you want by changing thefollowing registry key:

  •   Key:     MaxTraceFileCount
  •   Registry     Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office     Server\16.0\Search\Diagnostics\Tracing
IIS Log Files
  IISLog files write to the C:\inetpub directory by default. You can changethis to another drive, etc. These files can be 200MB+ and overtime will use upspace on the drive. To delete them, open up the following location:

  •   C:\inetpub\logs\LogFiles
DSC0006.png

  ·   Inside thisfolder you will have two other folders namely W3SVC1 and W3SVC2.Inside these are log files you can delete as well.
  You can also lookin the following folder for the same set of folders: C:\ProgramFiles\Microsoft\Exchange Server\V15\Logging\RpcHttp
DSC0007.png

  Here you canalso delete these files.
HTTP Proxy Logs
  Thelast place you can look as well for log files is in this location:

  •   C:\Program     Files\Microsoft\Exchange Server\V15\Logging\HttpProxy

  Locatedin each of the folders some files can be 10MB in>Conclusion
  Youshould be able to free up a few GBs of space.
PowerShell Script
  Ascript was also created which you can use in conjunction with Task Scheduler toclear files when you need to. You can find the script here:
  https://gallery.technet.microsoft.com/Clear-Exchange-2013-Log-71abba44
  以上链接可下载清理脚本。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-533612-1-1.html 上篇帖子: 关于Exchange Server 无中继出现大量外发邮件的解决办法 下篇帖子: exchange 2013 客户端不能自动发现
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表