排查问题的时候会发现IIS日志的时间跟服务器本地的时间有不同.

 

IIS Log的时区设置时GMT的. 注意, 中国的时区是GMT+8。

 

所以看中国的IIS日志, 要想知道服务器本地的时间, 需要在IIS的日志中+8。

 

使用Log Parser时, 可以使用下面的例子来对返回结果的时间进行转换.

LogParser "SELECT TO_TIMESTAMP(date, time) AS utc-timestamp, TO_LOCALTIME(utc-timestamp) AS local-timestamp, c-ip, cs-username, EXTRACT_TOKEN(cs-uri-stem,-1,'/') AS filename INTO DATAGRID FROM \\WEBSERVER\admin$\system32\logfiles\w3svc1\ex07*.log"

 

参考资料:

IIS Log File Entries Have the Incorrect Date and Time Stamp

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q271196 

Thread: Converting IIS Log Time to Local Time

http://forums.iis.net/t/1145241.aspx

相关文章:

  • 2022-12-23
  • 2022-02-06
  • 2021-10-30
  • 2022-01-18
  • 2021-12-30
  • 2021-10-22
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-09-06
  • 2021-09-09
  • 2021-07-28
相关资源
相似解决方案