IIS events are logged in the Application log. From the Start menu, click Run. In the Open box, type eventvwr. Click OK. Event Viewer is listed under the System Tools node. IIS administrators and developers who are creating IIS applications must sometimes quickly parse event and error logs to track the behavior of their applications. This solution can help the security of the system, because if a local hard drive crashes, the log data is still available on remote storage.
In addition, the log files can be consumed by analysis systems. Create a log-file directory on a remote server that is in the same domain as your local Web server running IIS.
In the folder's Properties page, on the Sharing tab, click Share so that the directory is shared. On the Security tab, assign groups and users with the appropriate permissions. Ensure that the appropriate groups and users are able to read and write to the log files.
For more information, see Configuring Permissions for Remote Logging. Double-click Logging. In the Directory text box, enter the full UNC path of the directory that you created on the remote server.
In the Actions pane, click Apply , and then click OK. All Web sites within the directory should begin logging data to the remote share. For more information, see Remote Logging. You can control disk usage of log files by running a script that automatically deletes log files that are older than a certain age. Running this script in a scheduled task will keep the problem of a disk filling up under control without constant maintenance.
The following VBScript will check the age of each log file in a folder and will delete any log file older than a specified age. To customize the script for your purposes, simply change the name and path of the folder in line 1 of the script, and change the maximum age to the desired value in days, in line 2.
The script above will scan all subfolders, so it will process logs for ALL sites in and under the folder specified. If you want to limit the process to just a single site, change the path appropriately. To run the script manually, execute the following script in an administrator command line: cscript. Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services. Privacy policy. You can configure logging on your web server or website that records information about HTTP requests and errors.
The information in your log can help you troubleshoot or optimize your website. To get the most from this tutorial, you must have access to a computer that is running one of the following operating systems:. You can perform this procedure by using the user interface UI , or by editing configuration files directly. On the Logging page, in the Log file section under Format , select one of the following log file formats:.
Under Directory , specify the path where the log file should be stored. Maximum file size in bytes : to create a log file when the file reaches a certain size in bytes. The minimum file size is bytes.
0コメント