Skip to content
On this page

Custom logger

If you want to change how information is logged by Vue Query, you can set a custom logger when creating a QueryClient or using VueQueryPlugin.

ts
const queryClient = new QueryClient({
  logger: {
    log: (...args) => {
      // Log debugging information
    },
    warn: (...args) => {
      // Log warning
    },
    error: (...args) => {
      // Log error
    },
  },
});
ts
const vueQueryPluginOptions: VueQueryPluginOptions = {
  queryClientConfig: {
    logger: {
      log: (...args) => {
        // Log debugging information
      },
      warn: (...args) => {
        // Log warning
      },
      error: (...args) => {
        // Log error
      },
    },
  },
};
app.use(VueQueryPlugin, vueQueryPluginOptions);

Released under the MIT License.