简体   繁体   中英

How to get PHP to store requested URLs in error_log file?

I'm getting a bunch of errors on Production environment that I can't reproduce locally. Therefore I'm looking to find out which URL the user is requesting. This URL is currently not being outputted to the error log, so I'm just wondering how I would go by displaying that?

you can print to log file using trigger_error ( http://php.net/trigger_error ), ie:

trigger_error($_SERVER[REQUEST_URI]);

trigger_error by default generates user level notification, so it will not break anything.

if REQUEST_URI is not enough, please check Get the full URL in PHP .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM