XF 2.0 Server Error Event

BoostN

Well-known member
I'm building more features into my Slack Notify add-on. I thought it would be useful to get notified when a server error takes place. I've done some digging and unfortunately I'm unable to figure out how to get that.

Any pointers or suggestions? I've tried to go backwards and figure out how the email service is creating those errors (Can't Connect to LocalHost, etc), but no luck yet.
 
You're wanting to extend a fairly low level component. It's sort of intentionally not extendable in the normal way, because the error logging system needs to try to work even in the face of other errors. However, it is possible.

You need to look at replacing the "error" component in the dependency injection container. You'll likely have to just replace this with your own version that will instantiate your own object directly (not using the class extension system). You can still base your object off the original one though (inherit from it).

You'd want to do this in a code event. App_setup would probably be best.
 
Top Bottom