We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Yes, you grok the code properly, and that is why it was changed Shadoze. Again, if a database connection error triggers logEvent, then you get into a looping situation.

    All of this is going away in 0.9.7, as it uses PDO objects to encapsulate each connection, as well as features configurable logging and improved error handling. But those changes do not fit the 0.9.6 branch. If someone has a solution to this to contribute for 0.9.6, we’ll be glad to consider it for inclusion in an 0.9.6.x maintenance release.
      • 27376
      • 576 Posts
      The problem here seems to be the 0.9.6 DBAPI calling $modx functions, this creates a dependency and as such, if one fails, they both will. I think the best solution would be to completely abstract DBAPI away from its reliance on any other class.

      I believe DBAPI should be "smart" enough to detect when the db connection fails and then fallback to filesystem logging, it would allow a somewhat graceful degradation and we’d be able to capture the last error that came up before MODx keeled over wink

      Perhaps some inspiration could come from the xPDO logging system?