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

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

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

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

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

IIS管理器位置截图:

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,

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

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

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

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

·   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

·   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

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-71abba44

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

时间: 2024-08-17 15:32:48

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

windows服务器清理系统垃圾日志文件

Windows服务器的系统盘如果是2003系统的话那么我们默认给10G的空间就够了,但是有时候我们不经意去查看系统盘的时候发现已经使用了9.9G,其实多是垃圾日志文件占用系统盘空间,使用如下批处理将这些文件删除. 在桌面新建一个文本文档,将如下代码复制进去: @echo off echo 正在清除系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %syst

IIS查看日志文件

1.打开iis 日志文件 2 .查看所处的日志文件地址 3 找到文件地址 默认会在C:\inetpub\logs\LogFiles (win7下面),里面会有一系列的文件名,类似W3SVC名文件. 里面就存有iis日志文件 4 打开日志文件 打开后发现都是一系列没有排序好的东东.最后通过度娘找到一个关于Log parser的玩意很好用, 下载地址:http://www.microsoft.com/en-us/download/confirmation.aspx?id=24659,根据提示安装完成

自动清理IIS log 日志脚本

系统环境:windows server 2012 r2 IIS 版本:IIS8 操作实现清理IIS log File 脚本如下: @echo off ::自动清理IIS Log file set log_path=C:\inetpub\logs\LogFiles ::清理所有log 日志 for /f "delims=" %%i in ('dir /b /a-d /s %log_path%\"*.Log"') do ( del /S /F /Q %%i ) paus

mongodb 2.6.x 清理过大日志文件的方法

一.日志清理步骤 1.使用数据库命令rotate日志,分别登陆到mongod和mongos实例上 # mongo --host localhost:27xxx MongoDB shell version: 2.6.x connecting to: localhost:27xxx/test replicaset003:SECONDARY> db test replicaset003:SECONDARY> use admin switched to db admin replicaset003:S

Logs日志文件太多怎么关闭日志功能————thinkphp

项目/Runtime/Logs/下的文件生成了很多很多,而且都是1M-2M的TXT文件有些网站小空间都被沾满了.哪位大虾知道怎么关闭这个日志功能'DB_SQL_LOG' => false, // SQL执行日志记录 /* 日志设置 */'LOG_RECORD' => false, // 默认不记录日志'LOG_TYPE' => 3, // 日志记录类型 0 系统 1 邮件 3 文件 4 SAPI 默认为文件方式'LOG_DEST' => '', // 日志记录目标'LOG_EXTR

使用作业自动清理数据库日志文件

原文:使用作业自动清理数据库日志文件 在上一篇文章中介绍了如何删除数据库日志文件,但是想想还是不是不方便需要手工操作,于是想结合作业实现自动清理日志文件,在清理日志文件时我加上了条件,当磁盘控空间不足多少M才会清理,下面介绍如何实现该功能.没有阅读上一篇文章的,可以通过传送门阅读(删除数据库日志文件的方法)! 阅读目录 SQL查询磁盘空间大小 存储过程添加作业 示例下载 回到顶部 SQL查询磁盘空间大小  采用内置的存储过程,即可查看各个磁盘可用空间 exec master..xp_fixedd

IIS7日志文件位置

准备统计下页面访问量 查找IIS日志,发现在以前IIS6日志的位置,竟然木有找到日志... 查看下IIS设置,发现IIS7和6的默认日志位置不一样额... IIS 6 Log files location IIS 6中日志文件的位置 %windir%\System32\LogFiles IIS 7 Log files location IIS的日志文件的位置 %SystemDrive%\inetpub\logs\LogFiles

Exchange邮件系统日志清理

Exchange邮件系统长期运行后会在日志文件夹中生成一个个的大小为1024KB的log文件,磁盘的占用量非常大,需要定期清理以便节省存储空间. 为了清理日志文件,通常有三种办法: 1.手动删除日志文件 直接查找并删除旧的日志文件 2.启用服务器的循环日志功能 选择邮件数据库,在维护设置中启用循环日志.记得在启用后需要卸载数据库,再挂载才能生效. 3.执行WindowsBackup清理Log 创建计划任务,定期执行备份操作,注意勾选高级选项VSSFull Backup.

删除mysql日志文件

今天发现网站不能正常访问,于是登陆服务器查找问题. 机智的我随手用命令:df -l 发现 硬盘爆满了,于是就知道 问题所在了. Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 20641404 16963004 16929876 100% / tmpfs 960368 0 960368 0% /dev/shm /dev/xvdb1 51599192 4845536 44132564 10% /home/sam/shar