Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Avoid sending E_WARNING to New relic


#1

Hi Guys,

I looked in the documentation but I couldn’t figured out how to avoid sending E_WARNING to newrelic for one of my applications.

I just want newrelic PHP agent to ignore E_WARNING in this app and report to dashboard only E_ERROR.

If someone can help, I will be thankful :smiley:

Thank you

José


#2

Hi @dearaujoj

New Relic picks up all errors PHP is configured to throw. So if you don’t want New Relic to pick up your E_WARNING errors you need to tell PHP not to log E_WARNING errors.

This would be achieved quite simply by modifying your php.ini file

In PHP code terms this would be

error_reporting(E_ALL & ~E_WARNING);

In your php.ini you would add

error_reporting = E_ALL & ~E_WARNING

This tilda tells PHP not to log an error of that type. So the above statement is log ALL errors except Warnings. This means you can define all levels you don’t want to log and PHP will not log them and New Relic will therefore not see them to report them.

Just for extra information, Even if PHP is reporting them, New Relic will never show in its dashboards error levels E_NOTICE or E_USER_NOTICE.

I hope this helps you resolve your issue.


Ignore Errors PHP
#3

Sorry for replying to this old message, but I noticed that I DO get E_USER_NOTICE exceptions reported in my error log. How can I get rid of these without just not throwing the exception in my application?