How to turn off Capacitor logs in Ionic Portals

I have an Ionic Angular SPA which is running in an Android Native app using Ionic Portals.

The Capacitor Plugins I’m using (for example Filesystem). I can’t turn the logging off. I’ve tried setting loggingBehavior to ‘none’ in the capacitor config for the SPA but that doesn’t work.

Is there some setting in Ionic Portals which will turn off the capacitor logging?

At the moment, I think you can kind of hack the Portal and pass in a Capacitor Config, but I don’t believe there is an API to turn logging on or off. I would open feat request on the Ionic Portals repo: GitHub - ionic-team/ionic-portals: Portals Library

1 Like

Answering my own question in case anyone else finds it useful (with thanks to Eric at Ionic for his help):

Bundle a capacitor.config.json file with the loggingBehavior setting inside the assets directory of your Android project. For an iOS project you put the file in the root directory of each SPA i.e. Android is one global setting for all your SPAs and iOS can be controlled on a per SPA basis.

Alternatively, you can programmatically add this configuration. For more information on both approaches, please look at the following Portals documentation page: Advanced Configuration - Ionic Portals.

1 Like