0

I have 3 domains that belong to the same organization and I am trying to come up with a proper and convenient means of handling errors across all sites.

For starters, my sites are designed as such:

  1. Error reporting is set to ALL
  2. Custom error handler throws exceptions
  3. All code (except the page header and footer) are wrapped in a try/catch
  4. On exception, a simple message is displayed to the user and the exception is logged to file (in a private folder)

This works fine, except that I have 3 websites to check for errors, and I often forget about 2 of them. The third shows the errors when a user logs in as administrator (as the file is locally available). All 3 sites are administrated via an admin portal on the main site.

I thought about logging the errors to database so the main site could show everything, but this breaks if it is a database error (such as temporarily unavailable).

Any suggestions would be appreciated.

1 Answer 1

1

Why not just put the errors in a file in a JSON array or something similar, and then make that file externally available for the appropriate sites?

Sign up to request clarification or add additional context in comments.

2 Comments

I prefer not to have the information available to the web. If, for instance, a user is completing a form when the error occurs, their information with be part of the log, and it could be sensitive or it may reveal source that that I would otherwise prefer to keep secret. (Although, I suppose I could encrypt it first.)
You can configure your .htaccess file to only allow the error log to be accessed from the IP of your other servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.