备案 控制台
开发者社区 开发与运维 文章 正文

EXCHANGE 13/16清理IIS LOGS日志文件(含脚本)

简介:

EXCHANGE 2013\2016清除IIS LOGS 日志文件。

在完成安装后,即使EXCHANGE不安装在系统盘也会在系统盘下生成IIS日志文件,使用RPC overHTTPMapi overHTTP协议,所以都是IIS提供各种服务,这些日志是每次用户连接到exchange时的日志,可以用来诊断连接问题或者安全问题。

 

默认位置:C:\inetpub\logs\LogFiles(默认C为系统盘的话)

可以在IIS管理器里面更改存储目录为别的盘符,并直接删掉这些目录文件,也可使用脚本进行清理。

 

IIS管理器位置截图:




wKioL1hZ1B7DalcaAAC5qaSMmEw819.png-wh_50



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 ideal.

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,

wKiom1hZ1F-TiiKJAAE94rukZho392.png-wh_50


  • Locate     the Microsoft Exchange Health Manager Service.

  • Double     click the service and change the startup to disabled. 

  • Stop     the service if it is running.

wKioL1hZ1I7D31bjAAEhKqqbGQk037.png-wh_50


  • 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.

wKiom1hZ1L-wCZ3XAAB4Yop89Jg097.png-wh_50


·   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.

wKioL1hZ1OOjWT5zAACwbc45SMk757.png-wh_50


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 size. The defaultregistry entry for this is to keep 100 files. We will adjust this value furtherdown.

Tolocate these files go to the following location:

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

wKiom1hZ1RWiG_FsAAEQE2Zvlbo942.png-wh_50


·   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    

wKiom1hZ1WCAPegcAACC2sVokk0295.png-wh_50


·   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

wKioL1hZ1Xvh6klXAAB6zhMtKGQ789.png-wh_50


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 size and generate quite a few.These logs will tell you if you have errors in your environment especially theRpcHttp folder.

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-71abba44http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-components-sitefiles/10_5F00_external.png

以上链接可下载清理脚本。


 本文转自 烟台小崔 51CTO博客,原文链接:http://blog.51cto.com/seawind/1884577


相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
科技小能手
目录
相关文章
风水道人
|
27天前
|
Linux Shell
Linux手动清理Linux脚本日志定时清理日志和log文件执行表达式
Linux手动清理Linux脚本日志定时清理日志和log文件执行表达式
风水道人
79 1
泡沫o0
|
1月前
|
监控 Shell Linux
【Shell 命令集合 系统管理 】Linux 自动轮转(log rotation)日志文件 logrotate命令 使用指南
【Shell 命令集合 系统管理 】Linux 自动轮转(log rotation)日志文件 logrotate命令 使用指南
泡沫o0
51 0
翔宇1
|
2天前
|
Java 数据安全/隐私保护 开发者
【SpringBoot】讲清楚日志文件&&lombok
【SpringBoot】讲清楚日志文件&&lombok
翔宇1
13 5
1941623231718325
|
9天前
|
运维 Oracle 关系型数据库
Oracle日志文件:数据王国的“记事本”
【4月更文挑战第19天】Oracle日志文件是数据库稳定运行的关键,记录数据变更历史,用于恢复和故障处理。它们协调并发操作,确保数据一致性和完整性。日志文件实时写入操作信息并定期刷新到磁盘,便于数据恢复。然而,日志文件需备份和归档以保证安全性,防止数据丢失。日志文件,数据王国的“记事本”,默默守护数据安全。
1941623231718325
20 1
泡沫o0
|
1月前
|
XML 运维 监控
【深入探究 C++ 日志库清理策略】glog、log4cplus 和 spdlog 的日志文件管理策略
【深入探究 C++ 日志库清理策略】glog、log4cplus 和 spdlog 的日志文件管理策略
泡沫o0
68 0
泡沫o0
|
1月前
|
监控 Shell Linux
【Shell 命令集合 系统管理 】Linux 实时监控日志文件 swatch命令 使用指南
【Shell 命令集合 系统管理 】Linux 实时监控日志文件 swatch命令 使用指南
泡沫o0
36 1
w风雨无阻w
|
1月前
|
JavaScript Windows
VUE部署到IIS中报404错误解决方案-配置URL重写
VUE部署到IIS中报404错误解决方案-配置URL重写
w风雨无阻w
26 0
王同学睡醒了
|
4月前
|
Windows
IIS配置MIME类型
IIS配置MIME类型
王同学睡醒了
40 0
啸啸说
|
11月前
|
开发框架 .NET Shell
安装与配置IIS
安装与配置IIS
啸啸说
202 0
安装与配置IIS
Nerohua
|
网络安全
IIS配置FTP
IIS配置FTP过程
Nerohua
235 0
IIS配置FTP

热门文章

最新文章

  • 1
    更优性能与性价比,从自建 ELK 迁移到 SLS 开始
  • 2
    使用Java代码打印log日志
  • 3
    Linux手动清理Linux脚本日志定时清理日志和log文件执行表达式
  • 4
    /var/log/auth.log日志详解
  • 5
    工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断(下)
  • 6
    Linux&Windows 日志分析 陇剑杯 CTF
  • 7
    R语言计量经济学:工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断
  • 8
    提升日志管理效率:掌握CKA认证中的边车容器技巧
  • 9
    centos7 Nginx Log日志统计分析 常用命令
  • 10
    基于Java的公司员工工作日志办公系统的设计与实现(源码+lw+部署文档+讲解等)
  • 1
    【SpringBoot】讲清楚日志文件&&lombok
    13
  • 2
    日志服务产品架构
    12
  • 3
    双击eclipse提示an error has occurred See the log file E:\javatool\eclipse-mars-2\configuration\156991769
    8
  • 4
    Git log 进阶用法(含格式化、以及数据过滤)
    7
  • 5
    [SpringAop + Logback +MDC] 现网必备全链路日志追踪
    21
  • 6
    工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断(下)
    74
  • 7
    Docker从入门到精通:Docker log 命令学习
    8
  • 8
    通过AOP记录操作日志:提升应用可追踪性与安全性的利器
    30
  • 9
    解决IDEA tomcat控制台只有server日志
    9
  • 10
    log4j异常日志过滤规则配置
    15
  • 相关课程

    更多
  • 日志服务SLS实现云产品可观测
  • 日志服务 SLS 可观测数据分析平台介绍
  • 大数据知识图谱系列—基于ELK+Flink日志全观测最佳实践
  • 场景实践-基于阿里云Quick BI 对MOOC网站日志分析
  • 相关电子书

    更多
  • PostgresChina2018_赖思超_PostgreSQL10_hash索引的WAL日志修改版final
  • Kubernetes下日志实时采集、存储与计算实践
  • 日志数据采集与分析对接
  • 相关实验场景

    更多
  • 通过日志服务实现云资源OSS的安全审计
  • 如何将OSS数据导入至SLS中进行分析
  • 日志服务之使用Nginx模式采集日志
  • 日志服务之数据清洗与入湖
  • 揭秘如何通过日志服务实现个人敏感信息保护
  • 下一篇
    部署LAMP环境(Alibaba Cloud Linux 3)

    聚圣源灵起名开心侠与我十年长跑的女友明天要嫁人了baihe.com七绝山classicshell茅山道士异界游宝宝起名图片姓潘的女孩子起名字向往的生活5完整版免费西瓜男孩起名什么少男生八字起名国学 起名字沙沟子的孽债老牛耕地书本小说2014年马女女孩起什么名字说服妈妈让她同意你在家里养一只小狗比较好记的起名狗年2018宝宝起名大全win7升级win10最新建筑公司起名大全小儿推拿起名字大全女孩取名看诗经男孩起名看楚辞三国请回答崩坏的三国演义封林徐若影小说全文阅读笔趣文化传媒公司名字起名大全苑子豪体育教师工作总结鼠年的人起名忌讳寄生兽2女孩取名起名大全程姓淀粉肠小王子日销售额涨超10倍罗斯否认插足凯特王妃婚姻让美丽中国“从细节出发”清明节放假3天调休1天男孩疑遭霸凌 家长讨说法被踢出群国产伟哥去年销售近13亿网友建议重庆地铁不准乘客携带菜筐雅江山火三名扑火人员牺牲系谣言代拍被何赛飞拿着魔杖追着打月嫂回应掌掴婴儿是在赶虫子山西高速一大巴发生事故 已致13死高中生被打伤下体休学 邯郸通报李梦为奥运任务婉拒WNBA邀请19岁小伙救下5人后溺亡 多方发声王树国3次鞠躬告别西交大师生单亲妈妈陷入热恋 14岁儿子报警315晚会后胖东来又人满为患了倪萍分享减重40斤方法王楚钦登顶三项第一今日春分两大学生合买彩票中奖一人不认账张家界的山上“长”满了韩国人?周杰伦一审败诉网易房客欠租失踪 房东直发愁男子持台球杆殴打2名女店员被抓男子被猫抓伤后确诊“猫抓病”“重生之我在北大当嫡校长”槽头肉企业被曝光前生意红火男孩8年未见母亲被告知被遗忘恒大被罚41.75亿到底怎么缴网友洛杉矶偶遇贾玲杨倩无缘巴黎奥运张立群任西安交通大学校长黑马情侣提车了西双版纳热带植物园回应蜉蝣大爆发妈妈回应孩子在校撞护栏坠楼考生莫言也上北大硕士复试名单了韩国首次吊销离岗医生执照奥巴马现身唐宁街 黑色着装引猜测沈阳一轿车冲入人行道致3死2伤阿根廷将发行1万与2万面值的纸币外国人感慨凌晨的中国很安全男子被流浪猫绊倒 投喂者赔24万手机成瘾是影响睡眠质量重要因素春分“立蛋”成功率更高?胖东来员工每周单休无小长假“开封王婆”爆火:促成四五十对专家建议不必谈骨泥色变浙江一高校内汽车冲撞行人 多人受伤许家印被限制高消费

    聚圣源 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化