Jump to content

Module Concept for Error Reporting via Email


Recommended Posts

Hello all,

I'm working on a concept for a module that sends error reports via email to different recipients based on different error levels (notice, warning, error) and I don't know yet how to best tackle this.

It would be preferable if I could use PW internal classes, functions. I had a read through https://processwire.com/blog/posts/debugging-tools-built-in/ and especially the logging section. But looking at related classes like FileLog and WireException, it doen't seem like one can hook into them.

I'm quite tempted to use NetteTracy, like TracyDebugger does. It seems like it can do what I want https://tracy.nette.org/en/guide#toc-production-mode-and-error-logging.

PW is writing errors/exceptions to the log, I just wouldn't know how to tap into this, especially for different log levels.

If anyone can point me in the right direction it would be much appreciated.

  • Like 1
Link to comment
Share on other sites

5 minutes ago, flydev said:

@gebeer Interesting. You want to hook WireLog::___save() and recover the type log on arguments(0)

👉  https://github.com/processwire/processwire/blob/dev/wire/core/WireLog.php#L96-L175

Good find, thank you. By default PW only logs errors, exceptions, not warnings or notices. So the available types would  be "error" and "exceptions". Is there a way of telling PW to also log warnings and notices?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...