Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log warnings #16

Open
piotrpog opened this issue Oct 2, 2019 · 6 comments
Open

Log warnings #16

piotrpog opened this issue Oct 2, 2019 · 6 comments
Assignees

Comments

@piotrpog
Copy link

piotrpog commented Oct 2, 2019

Can bugsnag plugin be set to log warnings?
For example, warning about email settings test failing. In log file it is represented by this:

2019-10-02 13:18:55 [-][1][-][info][yii\mail\BaseMailer::send] Sending email "This is a test email from Craft" to "[email protected]"
2019-10-02 13:18:55 [-][1][-][info][yii\swiftmailer\Mailer::sendMessage] Sending email "This is a test email from Craft" to "[email protected]"
2019-10-02 13:18:55 [-][1][-][warning][application] Error sending email: Process could not be started [The system cannot find the path specified.
@sjelfull
Copy link
Contributor

sjelfull commented Oct 2, 2019

Not sure, actually. Haven't worked a lot with hooking into that.

@engram-design Do you know?

@sjelfull sjelfull self-assigned this Oct 2, 2019
@engram-design
Copy link
Member

@sjelfull Not sure, I'll look into it!

@benface
Copy link

benface commented Oct 29, 2019

In fact, the plugin won't send logged errors (e.g. Craft::error('message')) to Bugsnag either, unless there was an uncaught exception. I think it should.

@FreekVR
Copy link
Contributor

FreekVR commented Dec 20, 2019

+1 -- and also -- exposing these through the service. From my own code,I cannot currently log Errors of Warnings to Bugsnag through the provided plugin service, only Exceptions.

Perhaps you could expose the entire BugsnagClient class from the plugin BugsnagService?

Then we could report errors using the bugsnag client directly instead of having to mirror everything through the plugin (which currently only does exceptions as mentioned).

Ex.
Bugsnag::$plugin->bugsnagService->getClient()->notifyError($e)
Bugsnag::$plugin->bugsnagService->getClient()->notifyException($e)

@sjelfull
Copy link
Contributor

@FreekVR Your PR will be included in the next release, out in a few minutes.

@engram-design
Copy link
Member

Related to #33 which will make it easier to capture warnings/info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants