PHP Logging Question - Error Codes -


I am creating logging scripts that will log the path of a visitor through the website. For example, it will have to write a log file: [user name (if logged in)] - [ip] request [page] on [time] - received [error code] [error code description].

Example output:

Jaxo (127.0.0.1) Accessed at 2:05 pm index.php - 200 OK received

I can do all the work Error code bit (after part -)

How can I get the error code and error code definitions from PHP?

Thank you!

These error codes (200, 404, etc.) are generated by your webserver, for example Apache In To burn errors, these errors are to be sent to another PHP script in your .htaccess file, for example.

  Error document 404 /error.php?error=404 ErrorDocument 500 / error .php? Error = 500 ErrorDocument 402 /error.php?error=402   

etc.

Unfortunately you can not document "catch everyone" error, so you have to list them one by one.

Comments