Even if the debug log is turned on the exceptions are not being logged in debug.log. But New Relic is giving me tons of error warnings because of the exceptions thrown by the plugin.
Is using try {} catch ( Exception $e ) standard practice for WordPress plugins? How should exceptions be logged?
]]>error_log()
function for this.
]]>
I know that I can use error_log()
The question for me is rather if exceptions should or should not be logged in debug.log regardless if I use error_log()
My opinion is they should be logged.
try {} catch ( Exception $e )
will not be triggered in PHP 7.
Need to use try {} catch ( Throwable $e )
instead