Open History to see the last commit
1---
2id: custom-logger
3title: Custom Logger
4---
5β
6If you want to change how information is logged by TanStack Query, you can set a custom logger when creating a `QueryClient`.
7β
8```tsx
9const queryClient = new QueryClient({
10 logger: {
11 log: (...args) => {
12 // Log debugging information
13 },
14 warn: (...args) => {
15 // Log warning
16 },
17 error: (...args) => {
18 // Log error
19 },
20 },
21})
22```
23β
24**Deprecated**
25β
26Custom loggers have been deprecated and will be removed in the next major version.
27Logging only has an effect in development mode, where passing a custom logger is not necessary.