Giter Club home page Giter Club logo

Comments (7)

ebrigham1 avatar ebrigham1 commented on August 19, 2024

Hi @jitendrar so glad you are finding the plugin useful. It is not currently possible to receive emails from anything but fatal errors and exceptions with this plugin. I'm going to look into the feasibility of adding emailing levels and the ability choose what level of error you get emailed about. In the meantime you should be able to see these warning/notice errors in your cake error logs (/path/to/your/cake/install/logs/error.log) assuming you're using the default configuration.

from cakephp-error-email.

jitendrar avatar jitendrar commented on August 19, 2024

Hi @ebrigham1

Thanks for quick reply.

I have also noticed that you have not added request IP address from which this error generated. Can you please also add that so we not have to do any customization in that.

Also, can you please let me know expected above changes date?

Thanks,
Jitendra

from cakephp-error-email.

ebrigham1 avatar ebrigham1 commented on August 19, 2024

Hi @jitendrar

I've made the changes so that now you can select what error levels you wish to be emailed about. You'll have to update your version of the plugin to 1.2.0 with composer update ebrigham1/cakephp-error-email from command line in order to receive the changes. You can see the new config information here: https://github.com/ebrigham1/cakephp-error-email#configuration The specific config key you will need to update is emailLevels. The default level is in line with the current functionality of the plugin. You'll want to update your local app.php config to contain something like:

'emailLevels' => ['exception', 'error', 'warning', 'notice', 'strict', 'deprecated'],

In order to receive an email for every possible error. Additionally I included the Client IP in the email templates. This should address your issue, if not please let me know.

from cakephp-error-email.

jitendrar avatar jitendrar commented on August 19, 2024

Hi @ebrigham1

It works great and now we are receiving all the errors as you have described. We are also getting client IP in email. Thanks for quick turn around.

One last thing needed if possible in that. We have few database related query errors which shows in browser but we are not getting error for them. Here, I have attached screen shot for that. Here, we are trying to access DB table column which is not exists. CakePHP gives it as "Database Error" (PDOException)

screenshot_3

from cakephp-error-email.

ebrigham1 avatar ebrigham1 commented on August 19, 2024

Hi @jitendrar

I just tested on a fresh cake install using code like this:

$query = $this->Bookmarks
    ->find()
    ->select(['id'])
    ->where(['wrong_column =' => 1]);
foreach($query as $bookmark) {
// Do something
}

It triggered the PDOException and I was emailed about the exception:

pdo_exception

Is it possible you have PDOException in your ErrorEmail.skipEmail config or in your Error.skipLog config? Another reason it might not be being sent is if you are catching the exception and handling it yourself. This plugin hooks into cakephp's global error/exception handler so it will only work on errors/exceptions which aren't caught in the app and handled by the app.

from cakephp-error-email.

jitendrar avatar jitendrar commented on August 19, 2024

Hi @ebrigham1

It is strange. It worked at your end and not worked at my end. I have not setup anything extra like Error.skipLog and ErrorEmail.skipEmail.

I have also installed fresh CakePHP and still not receiving PDOException email.

I think, I need to do some more R & D on that. If you have some time then we can chat on this on Skype and make solution otherwise I will try to do more R & D on my side.

Thanks for your help again.

from cakephp-error-email.

ebrigham1 avatar ebrigham1 commented on August 19, 2024

Hi @jitendrar

That is strange one thing I notice is your debug page for that error looks a little different from mine, yours includes the raw sql generated. Are you using any plugins or have you modified your error handling in any way that this exception is maybe not using the global cake exception handler/ErrorHandlerMiddleware?

Here is my debug page for reference for the same error that generated the email

pdo_error_debug

When installing the plugin did you replace

use Cake\Error\Middleware\ErrorHandlerMiddleware;

with

use ErrorEmail\Middleware\ErrorHandlerMiddleware;

in src/Application.php

Edit: Another thing to check would be if it isn't emailing about any exceptions or just PDO ones, you could put a

throw new \Exception("something bad happened");

in some controller and see if you get an email about it, that could help narrow down the cause.

from cakephp-error-email.

Related Issues (14)

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.