Where does IIS 7.5 log errors?

落爺英雄遲暮 提交于 2019-12-17 07:29:05

问题


Where does IIS 7.5 log errors?

Event Viewer? Log File?

I get a very non specific internal 500 error. I would like to find out more.

I'm running PHP and I did what this last comment on this post said. But still not logging to the C:\windows\temp.


回答1:


To report errors in the Event viewer, go to your php.ini and make sure logging is on.

log_errors = On

then enable error_log to write to syslog (with is the Event Viewer on Windows machines)

error_log = syslog



回答2:


For PHP v5.3, look here:

C:\Windows\Temp\PHP53_errors.log



回答3:


On my IIS 7.5 server I found this code in the php.ini file right down the bottom.

[WebPIChanges]
error_log=C:\Windows\temp\php54_errors.log
upload_tmp_dir=C:\Windows\temp
session.save_path=C:\Windows\temp
cgi.force_redirect=0
cgi.fix_pathinfo=1
fastcgi.impersonate=1
fastcgi.logging=0
max_execution_time=300
date.timezone=Australia/Canberra
extension_dir="C:\Program Files (x86)\PHP\v5.4\ext\"

I'm not sure if all of the above code is required because I'm not great with php.ini files but I can confirm the error log file is reachable and working.

This fix still requires the following if anyone is wondering.

log_errors = on
error_log = syslog



回答4:


I once had a problem where the error log wasn't writeable by php. I added the IUSR user to the file's security permissions (right-click the file, properties, security tab) with read write and modify permissions and was then able to see php errors in the log file.




回答5:


There should be a "Logging" icon on the site setup in IIS.

If you haven't changed the directory for that it looks like it defaults to %SystemDrive%\inetpub\logs\LogFiles

Look in your settings and I'd also recommend creating a logs folder above your site files to keep your logs separated.



来源:https://stackoverflow.com/questions/4764230/where-does-iis-7-5-log-errors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!