Remix app template - Logging

On my Shopify app, built using the Remix template, I am trying to set the logging configuration on the exported default shopify object.

const shopify = shopifyApp({
 //... previous properties
    process.env.NODE_ENV === "development"
      ? { httpRequests: true, level: LogSeverity.Info }
      : { httpRequests: false, level: LogSeverity.Warning, timestamps: true },
//... next properties
});

Yet I am still seeing http request and info logs on the production server. Why is it happening and how can I actually configure it properly?

Hey - some high level things you could try are:

  • The logging configuration for the Shopify app object is set at initialization time. If you are conditionally spreading logging options based on process.env.NODE_ENV, make sure that the logic is correct and that the environment variable is set as expected in your production environment.
  • Double-check that your production environment is actually setting NODE_ENV to "production". If it’s not, your app may be using the development logging configuration.
  • Ensure that the logging configuration object is being passed correctly and not being overridden elsewhere in your code.
  • If you are using a deployment platform (like Vercel, Heroku, etc.), verify their environment variable settings.