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

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介:

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




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:


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日志并进行多维度分析。
相关文章
|
14天前
|
存储 Oracle 关系型数据库
【赵渝强老师】MySQL InnoDB的数据文件与重做日志文件
本文介绍了MySQL InnoDB存储引擎中的数据文件和重做日志文件。数据文件包括`.ibd`和`ibdata`文件,用于存放InnoDB数据和索引。重做日志文件(redo log)确保数据的可靠性和事务的持久性,其大小和路径可由相关参数配置。文章还提供了视频讲解和示例代码。
123 11
【赵渝强老师】MySQL InnoDB的数据文件与重做日志文件
|
15天前
|
SQL Oracle 关系型数据库
【赵渝强老师】Oracle的控制文件与归档日志文件
本文介绍了Oracle数据库中的控制文件和归档日志文件。控制文件记录了数据库的物理结构信息,如数据库名、数据文件和联机日志文件的位置等。为了保护数据库,通常会进行控制文件的多路复用。归档日志文件是联机重做日志文件的副本,用于记录数据库的变更历史。文章还提供了相关SQL语句,帮助查看和设置数据库的日志模式。
【赵渝强老师】Oracle的控制文件与归档日志文件
|
15天前
|
Oracle 关系型数据库 数据库
【赵渝强老师】Oracle的参数文件与告警日志文件
本文介绍了Oracle数据库的参数文件和告警日志文件。参数文件分为初始化参数文件(PFile)和服务器端参数文件(SPFile),在数据库启动时读取并分配资源。告警日志文件记录了数据库的重要活动、错误和警告信息,帮助诊断问题。文中还提供了相关视频讲解和示例代码。
|
1月前
|
SQL 数据库
为什么 SQL 日志文件很大,我应该如何处理?
为什么 SQL 日志文件很大,我应该如何处理?
|
1月前
|
SQL 数据库
为什么SQL日志文件很大,该如何处理?
为什么SQL日志文件很大,该如何处理?
|
19天前
|
XML 安全 Java
【日志框架整合】Slf4j、Log4j、Log4j2、Logback配置模板
本文介绍了Java日志框架的基本概念和使用方法,重点讨论了SLF4J、Log4j、Logback和Log4j2之间的关系及其性能对比。SLF4J作为一个日志抽象层,允许开发者使用统一的日志接口,而Log4j、Logback和Log4j2则是具体的日志实现框架。Log4j2在性能上优于Logback,推荐在新项目中使用。文章还详细说明了如何在Spring Boot项目中配置Log4j2和Logback,以及如何使用Lombok简化日志记录。最后,提供了一些日志配置的最佳实践,包括滚动日志、统一日志格式和提高日志性能的方法。
156 30
【日志框架整合】Slf4j、Log4j、Log4j2、Logback配置模板
|
1月前
|
XML JSON Java
Logback 与 log4j2 性能对比:谁才是日志框架的性能王者?
【10月更文挑战第5天】在Java开发中,日志框架是不可或缺的工具,它们帮助我们记录系统运行时的信息、警告和错误,对于开发人员来说至关重要。在众多日志框架中,Logback和log4j2以其卓越的性能和丰富的功能脱颖而出,成为开发者们的首选。本文将深入探讨Logback与log4j2在性能方面的对比,通过详细的分析和实例,帮助大家理解两者之间的性能差异,以便在实际项目中做出更明智的选择。
244 3
|
3月前
|
Kubernetes Ubuntu Windows
【Azure K8S | AKS】分享从AKS集群的Node中查看日志的方法(/var/log)
【Azure K8S | AKS】分享从AKS集群的Node中查看日志的方法(/var/log)
136 3
|
1月前
|
存储 缓存 关系型数据库
MySQL事务日志-Redo Log工作原理分析
事务的隔离性和原子性分别通过锁和事务日志实现,而持久性则依赖于事务日志中的`Redo Log`。在MySQL中,`Redo Log`确保已提交事务的数据能持久保存,即使系统崩溃也能通过重做日志恢复数据。其工作原理是记录数据在内存中的更改,待事务提交时写入磁盘。此外,`Redo Log`采用简单的物理日志格式和高效的顺序IO,确保快速提交。通过不同的落盘策略,可在性能和安全性之间做出权衡。
1642 14
|
1月前
|
Python
log日志学习
【10月更文挑战第9天】 python处理log打印模块log的使用和介绍
35 0
下一篇
无影云桌面