---
title: "Use the logging utility from the JS SDK"
slug: "use-the-logging-utility-from-the-js-sdk"
abstract: "How to use the logging utility in Sitecore Search JS SDK to monitor and debug requests and responses."
---
# Use the logging utility from the JS SDK

Search JS SDK for React offers a [logging utility](https://doc.sitecore.com/search/en/developers/search-js-sdk-for-react/js-sdk-reference/logger-utility.html "Logger utility") that you can use during development. You can monitor data requests and responses, and also watch values while debugging in development.

To use the logging utility to print everything and debug:

- In the root of your application, to instantiate the logging utility, outside the `WidgetsProvider` wrapper, paste the following code block:

    ```javascript
    import { Logger } from 'sitecore-search/react';

    Logger.setLogLevel(Logger.DEBUG);
    ```

    > [!tip]
    > Use an environment variable as the value for the `Logger` level and to prevent tracing in production, set it to `Logger.NONE` for production.
    >
    > The `setLogLevel` function accepts [enum values](https://doc.sitecore.com/search/en/developers/search-js-sdk-for-react/working-with-js-sdk-and-ui-components/logger-utility.html "Logger utility").