Debugging does not work

I have set up a local development server running nginx, ubuntu 16.04 & php7 inside virtual box that I access over the local network. Everything works fine apart from debugging.

I have added the following to my wp-config.php

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );

However, debugging is not working at all.

If I generate an error in my plugin file like so:

trigger_error("Example error", E_USER_ERROR);

Then the whole wordpress (multisite) installation fails to load. I get a white screen with a 500 error in browser. No error message is displayed and also in my Nginx log the PHP error is not recorded.

If I generate a notice like so:

trigger_error("Example notice", E_USER_NOTICE);

Wordpress loads but there is no debug message at the top of the page and no log file is created.

This problem is only isolated to WordPress. If I do the same in a stand alone PHP file in the wordpress directory but not executed as a plugin, instead loaded directly in browser, the error messages display properly and also are recorded in the Nginx log for the site.

This is causing me major problems and I cannot find any info on it in Goolge.

The file ownership is user:www-data. Directories are 775 and files are 664. As error reporting seems to be working and logging fine for php files not in plugins it seems to be something directly related to wordpress.

Does anyone have any idea what is going on?