Console script tags garbling up non-html output (e.g. json) when in devMode I have a plugin returning json from a controller action using $this-&gt;returnJson(...).

Works great in production, but when devMode = true, the json is invalidated because Craft is still dumping the console debugging script at the end of the content.

What's the best way to avoid this?
Just remove these two logging routes from your plugin's init() method in your PluginHandlePlugin.php file:

craft()-&gt;log-&gt;removeRoute('WebLogRoute');
craft()-&gt;log-&gt;removeRoute('ProfileLogRoute');


That will prevent the extra logging and profiling information to be output in the browser's console when devMode is enabled.