Guides
Logging
Customize error logging.
Components log all errors to the browser’s console by default. You can customize this behavior using the LogProvider
component.
For example, if your app contains a Counter component, you can configure it to only log errors like this:
The LogProvider
component allows you to control logging behavior for your components. It works by:
- Using React’s context to share logging settings with child components
- Allowing you to specify which components to log by wrapping them
- Supporting different log levels:
error
- Only show errorswarn
- Show warnings and errorsinfo
- Show info messages, warnings and errorsdebug
- Show all log messagesoff
- Disable all logging
Was this page helpful?