Code Monkey home page Code Monkey logo

Comments (5)

o0h avatar o0h commented on August 21, 2024

Does Server::bootstrap() call pluginBootstlap()?

https://github.com/cakephp/cakephp/blame/4.0.7/src/Http/Server.php#L112-L114

Based on that, Middleware's responsibility can be supplemented for errors that occur inside of Application::handle().

from cake-sentry.

o0h avatar o0h commented on August 21, 2024

I would like to make it available without the need for manual rewriting by the user.
To do so, it's best if it can be completed by executing a single command.
If that's not possible, I'd like to at least have only one point to rewrite.
We need to register the Logger and register the ErrorHander.

What is the approach taken by the other plugins?
Here are a few picks from Awesome-cakephp. A brief survey is described below.

whoops error handler

https://github.com/dereuromark/cakephp-whoops

Instead of using "Plugin::load()", it is recommended to replace the simple way handlers are registered.
NOTE: This plugin doesn't need to register Logger.

database logger

https://github.com/dereuromark/CakePHP-DatabaseLog

This plugin instructs the user to run "plugin load" and set up the log by rewriting app.php.
FYI: The rewriting of "app.php" seems to be much simpler and less error-prone than the rewriting of bootstrap.

airbrake

https://github.com/chrisShick/AirbrakeCake

They take a similar approach to the whoops-plugin, with, said "You don't have to enable the Plugin because it uses an error handler. Therefore, all you have to do is replace this line in the app/Config/bootstrap.php".
In addition, they don't have bootstrap.php.

from cake-sentry.

o0h avatar o0h commented on August 21, 2024

The simplest approach would be something like this.

  • Keep the configuration as it is
    • Encapsulate the configuration changes in bootstrap.php.
  • Remove the description that recommends loading plugins by command
    • Require a manual rewrite of Application.php. In doing so.
    • Make it clear that "addPlugin()" needs to be called after " parent::bootstrap();".

from cake-sentry.

o0h avatar o0h commented on August 21, 2024

I was aware of an issue where the error wasn't properly passed to ErrorHandler and thought it was due to the timing of the bootstrapping.
However, that was a mistake, and it was eliminated by ef4487e

It is possible that ErrorHandler and Logger settings may be overridden due to compatibility with other plugins. Since the behavior is a matter of what the user is using, it may be enough to suggest the possibility without changing the basic method.

from cake-sentry.

o0h avatar o0h commented on August 21, 2024

Fix in c8b2b74

from cake-sentry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.