Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to enable IIS logging on Windows7

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to enable IIS logging on Windows7. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Select the appropriate logging level.

In the IIS7.0 version, system administrators can choose the appropriate logging level according to their own needs. You can manage logging at the server level, or you can implement it at the site, WEB application file, or directory level. The specific implementation at that level depends mainly on the needs of the system administrator. It should be noted, however, that the supported log file formats vary depending on the level of implementation. If implemented at the "server" level, there are only two log formats supported, the W3C format and the binary format. If you choose to implement log management at the "website" level, there are three log formats supported, namely, IIS, NCSA, and W3C. And if the system administrator feels that these formats are not satisfied, they can customize the format they need through a "custom" way. Therefore, when choosing the logging level, we not only need to consider what level of log management is more convenient and secure, but also need to combine your favorite log format. The author personally likes to manage logs at the website level. Because it may be wasteful to deploy only IIS services on a single server. That is, there may be multiple application services on the same server. In order to distinguish it from the logs of other application services and server operating systems, the author suggests that you manage it at the website level. Of course, at which level of log management, there is no actual difference in the content of the log. It mainly depends on the deployment of the server and the working habits of the system administrator.

Second, choose the appropriate format for the log record.

If you choose the site level to manage the log, there are a variety of options for this log format. Most importantly, the system administrator can choose the logging format of IIS. This IIS logging format is text-based logging. Similar to the W3C logging format, it is controlled through HTTP.SYS. However, this IIS logging format is a core mode process. Previous logging was managed in user mode. There is a big change between the two. The hypertext transfer protocol listener is implemented as a kernel-mode device driver named HTTP.SYS. HTTP.SYS is an important part of Windows network subsystem. In previous versions, when a Web site was created in IIS, HTTP.SYS was used to register the site, and then HTTP.SYS passed the Web request to the user-mode process of the running Web site. At the same time, HTTP.SYS also sends the response back to the client. Except for retrieving stored responses from its internal cache, HTTP.SYS does not process requests it receives. As a result, application-specific code is never loaded into kernel mode. But some system administrators want HTTP.SYS to run in core mode. At this point, you need to use IIS log format. In addition, IIS is a text-based log record, which is different from the log record in binary format, which can be viewed directly through tools such as a text browser. So it is more convenient to read.

Of course, the format of the log file is different, and the contents stored are all the same. Therefore, the format of the log file does not affect the actual management value of the log. However, for the convenience of management and maintenance in the future, the author establishes the system administrator or chooses the appropriate log format according to his own work habits.

Third, choose the appropriate coding format.

In general, there are two encoding formats for IIS log files, namely UTF-8 and ANSI. In all character sets, although ANSI is more famous. But this coding format can be said to be specially designed for English. Garbled code occurs when it is used to store other languages. For example, the support for Chinese is not very good. In order to solve this problem, a new coding format, UTF-8, is specially proposed. This is an UNICODEd, a variable length character encoding. If the UNICODE character is represented by 2 bytes, it will most likely take 3 bytes to encode into UTF-8, and if the UNICODE character is represented by 4 bytes, it may take 6 bytes to encode into UTF-8. UTF-8 coding can be read and written quickly by shielding bit and shift operation. When comparing strings, strcmp () and wcscmp () return the same result, making sorting easier. The bytes FF and FE never appear in UTF-8 encoding, so they can be used to indicate UTF-16 or UTF-32 text. UTF-8 is independent of byte order. Its byte order is the same in all systems.

The format of these character sets may be a bit esoteric for some system administrators. In fact, the system administrator does not need to know so clearly. You just need to understand one principle. That is, if what is shown in the log is in English, then there will be no problem with using the ANSI encoding format. But if there are other languages in the log, garbled may occur. Therefore, the author suggests that it is better to use the coding format of UTF-8. After all, its support for English is also very good. For this reason, it is better to set it to UTF-8 format once and for all. In order to avoid the trouble of garbled code in reading the log in the future.

Fourth, choose the appropriate rolling update mechanism of log files.

If you save all the log records of IIS in one file, it is obvious that the file will be very long. At that time, it will be troublesome to check the records. For this reason, log files can be divided into small files. This is convenient for follow-up inquiries and reading. In the IIS log of the Windows7 operating system, there are many ways to update log files scrolling. For example, you can create a new log file according to time. For example, log files can be updated daily, weekly or monthly. In general, it can be updated monthly. If the IIS server is accessed frequently, you can also shorten the interval between rolling updates of this log file. For example, the interval can be adjusted to one week or one day, and so on. How much this time interval is good mainly depends on the number of records. If there are a large number of log records, the time can be shortened appropriately. On the contrary, if the number of log records is not large, you can create new log files on a monthly basis.

In addition to creating new log files based on time, you can also create new log files based on the size of the log file. You can select * File size in the IIS Log Manager. Then enter an appropriate size. In this way, when the log file reaches the specified size, the system will automatically switch logs to it. However, the author does not agree with this method. Although it can control the redo log file to a reasonable size, it will break its inherent time relationship. At that time, it will be very inconvenient to inquire when there is a problem. Therefore, the author still establishes the division of the redo log file according to time.

In addition, the manager also provides another useful option, that is, whether to name and tumble the local time user file. This is a very useful option. When this option is selected, this time information is reflected in the log file automatically created by the system. This can be of great help for system administrators to find log files. In particular, if you split the redo log files by file size, be sure to select this option to facilitate subsequent search.

Thank you for reading! This is the end of the article on "how to enable IIS logging on Windows7". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report