Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to disable this in production? #1

Open
nikravi opened this issue Apr 6, 2023 · 1 comment
Open

how to disable this in production? #1

nikravi opened this issue Apr 6, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nikravi
Copy link

nikravi commented Apr 6, 2023

Hello,

first of all THANK YOU for such an awesome plugin!
Is there any possibility to disabled it conditionally? I tried

// plutins.ts
'strapi-plugin-graphql-logging': {
    enabled: true,
  }

and something similar in middlewares.ts but no luck.

Regards!

@tpimh
Copy link
Member

tpimh commented Apr 7, 2023

Hi Nicolae!

Thank you very much for testing my plugin. The correct syntax to disable it would be:

// plugins.ts
export default ({ env }) => ({
  'graphql-logging': {
    enabled: false,
  },
});

or simply:

// plugins.ts
export default ({ env }) => ({
  'graphql-logging': false
});

Finally, to only disable it in production, you can do this trick:

export default ({ env }) => ({
  'graphql-logging': env('NODE_ENV') !== 'production',
});

I hope this is helpful.

Disabling debugging in production is a very good idea, and I think this should be the default behaviour for the future releases of this plugin.

@tpimh tpimh self-assigned this Apr 17, 2023
@tpimh tpimh added the enhancement New feature or request label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants